Skip to content

Commit 0f8ec1f

Browse files
bpo-41113: Fix test_warnings on non-Western locales. (GH-21143)
1 parent aad8f0e commit 0f8ec1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_warnings/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,13 +1198,13 @@ def test_default_filter_configuration(self):
11981198
@unittest.skipUnless(sys.getfilesystemencoding() != 'ascii',
11991199
'requires non-ascii filesystemencoding')
12001200
def test_nonascii(self):
1201+
PYTHONWARNINGS="ignore:DeprecationWarning" + (support.FS_NONASCII or '')
12011202
rc, stdout, stderr = assert_python_ok("-c",
12021203
"import sys; sys.stdout.write(str(sys.warnoptions))",
12031204
PYTHONIOENCODING="utf-8",
1204-
PYTHONWARNINGS="ignore:DeprecaciónWarning",
1205+
PYTHONWARNINGS=PYTHONWARNINGS,
12051206
PYTHONDEVMODE="")
1206-
self.assertEqual(stdout,
1207-
"['ignore:DeprecaciónWarning']".encode('utf-8'))
1207+
self.assertEqual(stdout, str([PYTHONWARNINGS]).encode())
12081208

12091209
class CEnvironmentVariableTests(EnvironmentVariableTests, unittest.TestCase):
12101210
module = c_warnings

0 commit comments

Comments
 (0)