summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorDong-hee Na <donghee.na92@gmail.com>2020-09-04 08:47:40 (GMT)
committerGitHub <noreply@github.com>2020-09-04 08:47:40 (GMT)
commit54a66ade2067c373d31003ad260e1b7d14c81564 (patch)
treec9462db2ac441cd34a3c8b2e9410447fd9a05c70 /Lib
parentcdbff3527c5b10e79761ad25316b46cd079304bc (diff)
downloadcpython-54a66ade2067c373d31003ad260e1b7d14c81564.zip
cpython-54a66ade2067c373d31003ad260e1b7d14c81564.tar.gz
cpython-54a66ade2067c373d31003ad260e1b7d14c81564.tar.bz2
bpo-41700: Skip test if the locale is not supported (GH-22081)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_c_locale_coercion.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py
index 8340a9e..fcc8599 100644
--- a/Lib/test/test_c_locale_coercion.py
+++ b/Lib/test/test_c_locale_coercion.py
@@ -407,7 +407,10 @@ class LocaleCoercionTests(_LocaleHandlingTestCase):
# skip the test if the LC_CTYPE locale is C or coerced
old_loc = locale.setlocale(locale.LC_CTYPE, None)
self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc)
- loc = locale.setlocale(locale.LC_CTYPE, "")
+ try:
+ loc = locale.setlocale(locale.LC_CTYPE, "")
+ except locale.Error as e:
+ self.skipTest(str(e))
if loc == "C":
self.skipTest("test requires LC_CTYPE locale different than C")
if loc in TARGET_LOCALES :