mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Backport 0398f07d4827 (fix for weird buildbot failures)
This commit is contained in:
parent
ba2eab25ff
commit
2a20f9be70
2 changed files with 4 additions and 4 deletions
|
@ -1234,7 +1234,7 @@ class CodecsModuleTest(unittest.TestCase):
|
||||||
def test_lookup_issue1813(self):
|
def test_lookup_issue1813(self):
|
||||||
# Issue #1813: under Turkish locales, lookup of some codecs failed
|
# Issue #1813: under Turkish locales, lookup of some codecs failed
|
||||||
# because 'I' is lowercased as "ı" (dotless i)
|
# because 'I' is lowercased as "ı" (dotless i)
|
||||||
oldlocale = locale.getlocale(locale.LC_CTYPE)
|
oldlocale = locale.setlocale(locale.LC_CTYPE)
|
||||||
self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
|
self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
|
||||||
try:
|
try:
|
||||||
locale.setlocale(locale.LC_CTYPE, 'tr_TR')
|
locale.setlocale(locale.LC_CTYPE, 'tr_TR')
|
||||||
|
|
|
@ -393,16 +393,16 @@ class TestMiscellaneous(unittest.TestCase):
|
||||||
|
|
||||||
def test_getsetlocale_issue1813(self):
|
def test_getsetlocale_issue1813(self):
|
||||||
# Issue #1813: setting and getting the locale under a Turkish locale
|
# Issue #1813: setting and getting the locale under a Turkish locale
|
||||||
oldlocale = locale.getlocale()
|
oldlocale = locale.setlocale(locale.LC_CTYPE)
|
||||||
self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
|
self.addCleanup(locale.setlocale, locale.LC_CTYPE, oldlocale)
|
||||||
try:
|
try:
|
||||||
locale.setlocale(locale.LC_CTYPE, 'tr_TR')
|
locale.setlocale(locale.LC_CTYPE, 'tr_TR')
|
||||||
except locale.Error:
|
except locale.Error:
|
||||||
# Unsupported locale on this system
|
# Unsupported locale on this system
|
||||||
self.skipTest('test needs Turkish locale')
|
self.skipTest('test needs Turkish locale')
|
||||||
loc = locale.getlocale()
|
loc = locale.getlocale(locale.LC_CTYPE)
|
||||||
locale.setlocale(locale.LC_CTYPE, loc)
|
locale.setlocale(locale.LC_CTYPE, loc)
|
||||||
self.assertEqual(loc, locale.getlocale())
|
self.assertEqual(loc, locale.getlocale(locale.LC_CTYPE))
|
||||||
|
|
||||||
|
|
||||||
def test_main():
|
def test_main():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue