Skip to content

Commit 43f5df5

Browse files
authored
make the locale_flag fallback code work again (#375)
1 parent f870a48 commit 43f5df5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Lib/test/test_re.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,6 +1400,8 @@ def test_ascii_and_unicode_flag(self):
14001400
def test_locale_flag(self):
14011401
import locale
14021402
enc = locale.getpreferredencoding(False)
1403+
bletter = None
1404+
bpat = b'A'
14031405
# Search non-ASCII letter
14041406
for i in range(128, 256):
14051407
try:
@@ -1413,9 +1415,6 @@ def test_locale_flag(self):
14131415
break
14141416
except (UnicodeError, TypeError):
14151417
pass
1416-
else:
1417-
bletter = None
1418-
bpat = b'A'
14191418
# Bytes patterns
14201419
pat = re.compile(bpat, re.LOCALE | re.IGNORECASE)
14211420
if bletter:

0 commit comments

Comments
 (0)