summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2017-03-01 07:59:12 (GMT)
committerGitHub <noreply@github.com>2017-03-01 07:59:12 (GMT)
commit43f5df5bfaea5a07c913d12cb92f78f997feb371 (patch)
tree54723b58ba7cda0cce995210478f59e07823da5a /Lib/test/test_re.py
parentf870a4839a648a6cd8d25550a64d949c757abee7 (diff)
downloadcpython-43f5df5bfaea5a07c913d12cb92f78f997feb371.zip
cpython-43f5df5bfaea5a07c913d12cb92f78f997feb371.tar.gz
cpython-43f5df5bfaea5a07c913d12cb92f78f997feb371.tar.bz2
make the locale_flag fallback code work again (#375)
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 92d2c13..a195320 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -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: