make the locale_flag fallback code work again (#375)

This commit is contained in:
Benjamin Peterson 2017-02-28 23:59:12 -08:00 committed by GitHub
parent f870a4839a
commit 43f5df5bfa
1 changed files with 2 additions and 3 deletions

View File

@ -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: