Skip to content

Commit 4bcff52

Browse files
bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22086)
(cherry picked from commit 54a66ad) Co-authored-by: Dong-hee Na <[email protected]> Co-authored-by: Dong-hee Na <[email protected]>
1 parent 40e2444 commit 4bcff52

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Lib/test/test_c_locale_coercion.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,10 @@ def test_PYTHONCOERCECLOCALE_set_to_one(self):
403403
# skip the test if the LC_CTYPE locale is C or coerced
404404
old_loc = locale.setlocale(locale.LC_CTYPE, None)
405405
self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc)
406-
loc = locale.setlocale(locale.LC_CTYPE, "")
406+
try:
407+
loc = locale.setlocale(locale.LC_CTYPE, "")
408+
except locale.Error as e:
409+
self.skipTest(str(e))
407410
if loc == "C":
408411
self.skipTest("test requires LC_CTYPE locale different than C")
409412
if loc in TARGET_LOCALES :

0 commit comments

Comments
 (0)