]> 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>
Mon, 13 Mar 2023 11:11:09 +0000 (04:11 -0700)
committerGitHub <noreply@github.com>
Mon, 13 Mar 2023 11:11:09 +0000 (04:11 -0700)
commit5bdcb08250d00a82f6a537ce1b7b78cd70567225
tree05c1a783a62e92c0911f066e825ff393e623b6de
parent281078794f10a42d0aa99d660e25a434fde96ec4
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]