summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-02-19 04:33:35 (GMT)
committerGitHub <noreply@github.com>2017-02-19 04:33:35 (GMT)
commit0683d6889bd4430599d22e12e201b8e9c45be5a2 (patch)
treed13cda69479e403ec2a750666c9c32ef30a4d7be /Lib/test/test_re.py
parentd372cda5cd46712c4e59262ec1ab981773b20bff (diff)
downloadcpython-0683d6889bd4430599d22e12e201b8e9c45be5a2.zip
cpython-0683d6889bd4430599d22e12e201b8e9c45be5a2.tar.gz
cpython-0683d6889bd4430599d22e12e201b8e9c45be5a2.tar.bz2
[3.6] bpo-29571: Use correct locale encoding in test_re (#149) (#153)
``local.getlocale(locale.LC_CTYPE)`` and ``locale.getpreferredencoding(False)`` may give different answers in some cases (such as the ``en_IN`` locale). ``re.LOCALE`` uses the latter, so update the test case to match.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index b945cf0..a506b98 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1402,7 +1402,7 @@ class ReTests(unittest.TestCase):
def test_locale_flag(self):
import locale
- _, enc = locale.getlocale(locale.LC_CTYPE)
+ enc = locale.getpreferredencoding(False)
# Search non-ASCII letter
for i in range(128, 256):
try: