Skip to content

Commit

Permalink
bpo-41700: Skip test if the locale is not supported (pythonGH-22081)
Browse files Browse the repository at this point in the history
(cherry picked from commit 54a66ad)

Co-authored-by: Dong-hee Na <[email protected]>
  • Loading branch information
corona10 authored and miss-islington committed Sep 4, 2020
1 parent 8d68e59 commit ec80042
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Lib/test/test_c_locale_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,10 @@ def test_PYTHONCOERCECLOCALE_set_to_one(self):
# 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 :
Expand Down

0 comments on commit ec80042

Please sign in to comment.