Skip to content

Commit 13d3a0f

Browse files
corona10Seth Sims
authored and
Seth Sims
committed
bpo-41700: Skip test if the locale is not supported (pythonGH-22081)
1 parent 085e838 commit 13d3a0f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: Lib/test/test_c_locale_coercion.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,10 @@ def test_PYTHONCOERCECLOCALE_set_to_one(self):
407407
# skip the test if the LC_CTYPE locale is C or coerced
408408
old_loc = locale.setlocale(locale.LC_CTYPE, None)
409409
self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc)
410-
loc = locale.setlocale(locale.LC_CTYPE, "")
410+
try:
411+
loc = locale.setlocale(locale.LC_CTYPE, "")
412+
except locale.Error as e:
413+
self.skipTest(str(e))
411414
if loc == "C":
412415
self.skipTest("test requires LC_CTYPE locale different than C")
413416
if loc in TARGET_LOCALES :

0 commit comments

Comments
 (0)