◐ Shell
clean mode source ↗

GH-102537: Handle check for PYTHONTZPATH failing in zoneinfo test by pganssle · Pull Request #102538 · python/cpython

added 2 commits

March 8, 2023 13:18
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.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 10, 2023
…st (pythonGH-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 64bde50)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 10, 2023
…st (pythonGH-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 64bde50)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>

miss-islington added a commit that referenced this pull request

Mar 10, 2023
…-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 64bde50)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>

miss-islington added a commit that referenced this pull request

Mar 13, 2023
…-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 64bde50)

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>