diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 407f3468e86671..9acd5abbfd7776 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1334,7 +1334,7 @@ def test_ascii_and_unicode_flag(self): def test_locale_flag(self): import locale - enc = locale.getpreferredencoding(False) + _, enc = locale.getlocale(locale.LC_CTYPE) # Search non-ASCII letter for i in range(128, 256): try: