Filipe Laíns <la...@riseup.net> added the comment: The supress(FileNotFoundError) context manager now is only active when fetching the file, not during importlib.resources.path. _path_from_resource_path is not longer a generator, so supress(FileNotFoundError) is promptly closed after the return, preventing its side effects from leaking outside the function.
Your reproducible now works as intended: Traceback (most recent call last): File "/home/anubis/git/cpython/test.py", line 9, in <module> main() File "/home/anubis/git/cpython/test.py", line 6, in main raise FileNotFoundError() FileNotFoundError ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44137> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com