Skip to content

Commit

Permalink
bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22086
Browse files Browse the repository at this point in the history
)

(cherry picked from commit 54a66ad)

Co-authored-by: Dong-hee Na <[email protected]>

Co-authored-by: Dong-hee Na <[email protected]>
  • Loading branch information
miss-islington and corona10 authored Sep 4, 2020
1 parent 40e2444 commit 4bcff52
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 @@ -403,7 +403,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 4bcff52

Please sign in to comment.