Skip to content

Commit

Permalink
make the locale_flag fallback code work again (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminp committed Mar 1, 2017
1 parent f870a48 commit 43f5df5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Lib/test/test_re.py
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 43f5df5

Please sign in to comment.