Skip to content

make the locale_flag fallback code work again #375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Lib/test/test_re.py
Original file line number Diff line number Diff line change
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