Kaydet (Commit) 43f5df5b authored tarafından Benjamin Peterson's avatar Benjamin Peterson Kaydeden (comit) GitHub

make the locale_flag fallback code work again (#375)

üst f870a483
...@@ -1400,6 +1400,8 @@ class ReTests(unittest.TestCase): ...@@ -1400,6 +1400,8 @@ class ReTests(unittest.TestCase):
def test_locale_flag(self): def test_locale_flag(self):
import locale import locale
enc = locale.getpreferredencoding(False) enc = locale.getpreferredencoding(False)
bletter = None
bpat = b'A'
# Search non-ASCII letter # Search non-ASCII letter
for i in range(128, 256): for i in range(128, 256):
try: try:
...@@ -1413,9 +1415,6 @@ class ReTests(unittest.TestCase): ...@@ -1413,9 +1415,6 @@ class ReTests(unittest.TestCase):
break break
except (UnicodeError, TypeError): except (UnicodeError, TypeError):
pass pass
else:
bletter = None
bpat = b'A'
# Bytes patterns # Bytes patterns
pat = re.compile(bpat, re.LOCALE | re.IGNORECASE) pat = re.compile(bpat, re.LOCALE | re.IGNORECASE)
if bletter: if bletter:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment