bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22086)
(cherry picked from commit 54a66ade20
)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
This commit is contained in:
parent
40e2444c36
commit
4bcff52447
|
@ -403,7 +403,10 @@ class LocaleCoercionTests(_LocaleHandlingTestCase):
|
||||||
# skip the test if the LC_CTYPE locale is C or coerced
|
# skip the test if the LC_CTYPE locale is C or coerced
|
||||||
old_loc = locale.setlocale(locale.LC_CTYPE, None)
|
old_loc = locale.setlocale(locale.LC_CTYPE, None)
|
||||||
self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc)
|
self.addCleanup(locale.setlocale, locale.LC_CTYPE, old_loc)
|
||||||
|
try:
|
||||||
loc = locale.setlocale(locale.LC_CTYPE, "")
|
loc = locale.setlocale(locale.LC_CTYPE, "")
|
||||||
|
except locale.Error as e:
|
||||||
|
self.skipTest(str(e))
|
||||||
if loc == "C":
|
if loc == "C":
|
||||||
self.skipTest("test requires LC_CTYPE locale different than C")
|
self.skipTest("test requires LC_CTYPE locale different than C")
|
||||||
if loc in TARGET_LOCALES :
|
if loc in TARGET_LOCALES :
|
||||||
|
|
Loading…
Reference in New Issue