gh-91904: Fix setting envvar PYTHONREGRTEST_UNICODE_GUARD (GH-91905)

It always failed on non-UTF-8 locale and prevented running regrtests.
(cherry picked from commit 54d068adfb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-04-25 08:03:47 -07:00 committed by GitHub
parent dc31334ab1
commit 971343eb56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View file

@ -1303,7 +1303,7 @@ def test_threading_excepthook(self):
def test_unicode_guard_env(self):
guard = os.environ.get(setup.UNICODE_GUARD_ENV)
self.assertIsNotNone(guard, f"{setup.UNICODE_GUARD_ENV} not set")
if guard != "\N{SMILING FACE WITH SUNGLASSES}":
if guard.isascii():
# Skip to signify that the env var value was changed by the user;
# possibly to something ASCII to work around Unicode issues.
self.skipTest("Modified guard")