Is there a pythonic way to wrap an class using with statement?

I did the following, it works, but I have doubts on its robustness.
import B

class A():
def __init__(self):
self._b = B()

def __enter__(self):
return self._b .__enter__()

def __exit__(self, exc_type, exc_val,…