]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test (GH-102538)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 10 Mar 2023 15:54:45 +0000 (07:54 -0800)
committerGitHub <noreply@github.com>
Fri, 10 Mar 2023 15:54:45 +0000 (07:54 -0800)
commit123119ff8880986c7deae72484e2458f786f5ed3
treee241c92ed3ee6f4a2753cfff9be0beab1c7428d6
parent495cd2de77e9a67a409696531eeaa980ef3c77a8
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.
(cherry picked from commit 64bde502cf89963bc7382b03ea9e1c0967d22e35)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
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]