]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)
authorPaul Ganssle <1377457+pganssle@users.noreply.github.com>
Fri, 10 Mar 2023 15:29:37 +0000 (10:29 -0500)
committerGitHub <noreply@github.com>
Fri, 10 Mar 2023 15:29:37 +0000 (07:29 -0800)
commit64bde502cf89963bc7382b03ea9e1c0967d22e35
treedde32b0e54a44f0ab0e293cfe8d5fdb046f9b789
parent53dceb53ade15587b9cfd30c0a0942232517dee9
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)

It is possible but unlikely for the `python_tzpath_context` function to fail between the start of the `try` block and the point where `os.environ.get` succeeds, in which case `old_env` will be undefined. In this case, we want to take no action.

Practically speaking this will really only happen in an error condition anyway, so it doesn't really matter, but we should probably do it right anyway.
Lib/test/test_zoneinfo/test_zoneinfo.py
Misc/NEWS.d/next/Tests/2023-03-08-13-54-20.gh-issue-102537.Vfplpb.rst [new file with mode: 0644]