def _push_cm_exit(self, cm, cm_exit):
        def _exit_wrapper(*exc_details):
            return cm_exit(cm, *exc_details)
        _exit_wrapper.__self__ = cm
        self.push(_exit_wrapper)
Helper to correctly register callbacks to __exit__ methods
dataset/ETHPy150Open amrdraz/kodr/app/brython/www/src/Lib/contextlib.py/ExitStack._push_cm_exit