summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2017-02-18 09:31:22 (GMT)
committerGitHub <noreply@github.com>2017-02-18 09:31:22 (GMT)
commitace5c0fdd9b962e6e886c29dbcea72c53f051dc4 (patch)
tree42ccb556dbc142665c461cd02d76b4ad5dbfd1d6 /Lib/test/test_re.py
parent1b3d88eb33085e90af729c4c2f78b5ba1b942b1e (diff)
downloadcpython-ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.zip
cpython-ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.tar.gz
cpython-ace5c0fdd9b962e6e886c29dbcea72c53f051dc4.tar.bz2
bpo-29571: Use correct locale encoding in test_re (#149)
``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 1d7fb76..92d2c13 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -1399,7 +1399,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: