Filipe Laíns <la...@riseup.net> added the comment: Alternatively, can't we just os.chdir(self._old_cwd) in __enter__ and preemptively fail? IMO it's probably better to just straight up fail if we can chdir back to the original directory than to have relatively fragile recovery logic.
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45545> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com