Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
I think that the current code is not correct. __exit__ should not be called if __enter__ is failed. If some __enter__ implementation calls other __enter__s it should manually call corresponding __exit__s. ---------- nosy: +michael.foord, ncoghlan, serhiy.storchaka versions: +Python 3.8, Python 3.9 -Python 3.5, Python 3.6 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40126> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com