(self, cm)
return result
Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
Enters the supplied context manager.
Enters the supplied context manager .
def enter_context(self, cm):
        """Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        """
        # We look up the special methods on the type to match the with
        # statement.
        _cm_type = type(cm)
        _exit = _cm_type.__exit__
        result = _cm_type.__enter__(cm)
        self._push_cm_exit(cm, _exit)
        return result
def enter_context ( self , cm ) : # We look up the special methods on the type to match the with # statement. _cm_type = type ( cm ) _exit = _cm_type . __exit__ result = _cm_type . __enter__ ( cm ) self . _push_cm_exit ( cm , _exit ) return result