diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 92d2c1386de464..a1953209e49b53 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1400,6 +1400,8 @@ def test_ascii_and_unicode_flag(self): def test_locale_flag(self): import locale enc = locale.getpreferredencoding(False) + bletter = None + bpat = b'A' # Search non-ASCII letter for i in range(128, 256): try: @@ -1413,9 +1415,6 @@ def test_locale_flag(self): break except (UnicodeError, TypeError): pass - else: - bletter = None - bpat = b'A' # Bytes patterns pat = re.compile(bpat, re.LOCALE | re.IGNORECASE) if bletter: