]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41700: Skip test if the locale is not supported (GH-22081) (GH-22086)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 4 Sep 2020 09:55:44 +0000 (02:55 -0700)
committerGitHub <noreply@github.com>
Fri, 4 Sep 2020 09:55:44 +0000 (18:55 +0900)
(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>
Lib/test/test_c_locale_coercion.py

index fb599b0fcb7a58e3a229b2d2b3380b9248b68238..418f9b6154b53b2bb9b8090a22b7889c077f4517 100644 (file)
@@ -403,7 +403,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 :