Skip to content

Commit 664ebb0

Browse files
Issue python#20086: Output more details when test_getsetlocale_issue1813 is failed.
1 parent 0f11d0f commit 664ebb0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/test/test_locale.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,12 @@ def test_getsetlocale_issue1813(self):
477477
# Unsupported locale on this system
478478
self.skipTest('test needs Turkish locale')
479479
loc = locale.getlocale()
480-
locale.setlocale(locale.LC_CTYPE, loc)
480+
try:
481+
locale.setlocale(locale.LC_CTYPE, loc)
482+
except Exception as e:
483+
self.fail("Failed to set locale %r (default locale is %r): %r" %
484+
(loc, oldlocale, e))
485+
print("set locale %r (default locale is %r)" % (loc, oldlocale))
481486
self.assertEqual(loc, locale.getlocale())
482487

483488
def test_normalize_issue12752(self):

0 commit comments

Comments
 (0)