diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-09-04 09:55:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-04 09:55:25 (GMT) |
commit | 8f13ff959ae43fb6b8217845b2945779fe693b84 (patch) | |
tree | b67f060adb749d821dda883f7666b6e84e2b5278 | |
parent | 8d68e59f11267ded765d4af6d71a49784a12fad5 (diff) | |
download | cpython-8f13ff959ae43fb6b8217845b2945779fe693b84.zip cpython-8f13ff959ae43fb6b8217845b2945779fe693b84.tar.gz cpython-8f13ff959ae43fb6b8217845b2945779fe693b84.tar.bz2 |
bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22085)
(cherry picked from commit 54a66ade2067c373d31003ad260e1b7d14c81564)
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
-rw-r--r-- | Lib/test/test_c_locale_coercion.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_c_locale_coercion.py b/Lib/test/test_c_locale_coercion.py index 8340a9e..fcc8599 100644 --- a/Lib/test/test_c_locale_coercion.py +++ b/Lib/test/test_c_locale_coercion.py @@ -407,7 +407,10 @@ class LocaleCoercionTests(_LocaleHandlingTestCase): # 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 : |