From: Benjamin Peterson Date: Wed, 1 Mar 2017 07:59:12 +0000 (-0800) Subject: make the locale_flag fallback code work again (#375) X-Git-Tag: v3.7.0a1~1249 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=43f5df5bfaea5a07c913d12cb92f78f997feb371;p=python make the locale_flag fallback code work again (#375) --- diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 92d2c1386d..a1953209e4 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1400,6 +1400,8 @@ class ReTests(unittest.TestCase): 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 @@ class ReTests(unittest.TestCase): break except (UnicodeError, TypeError): pass - else: - bletter = None - bpat = b'A' # Bytes patterns pat = re.compile(bpat, re.LOCALE | re.IGNORECASE) if bletter: