mirror of
https://github.com/python/cpython.git
synced 2025-11-28 14:11:15 +00:00
Reset old locale after running tests. Not doing so broke
test_format/test_unicode in some circumstances (patch #1007539/bug #992078).
This commit is contained in:
parent
7c399d3e68
commit
404b06814c
1 changed files with 23 additions and 19 deletions
|
|
@ -13,6 +13,8 @@ candidate_locales = ['es_UY', 'fr_FR', 'fi_FI', 'es_CO', 'pt_PT', 'it_IT',
|
||||||
'eu_ES', 'vi_VN', 'af_ZA', 'nb_NO', 'en_DK', 'tg_TJ',
|
'eu_ES', 'vi_VN', 'af_ZA', 'nb_NO', 'en_DK', 'tg_TJ',
|
||||||
'es_ES.ISO8859-1', 'fr_FR.ISO8859-15', 'ru_RU.KOI8-R', 'ko_KR.eucKR']
|
'es_ES.ISO8859-1', 'fr_FR.ISO8859-15', 'ru_RU.KOI8-R', 'ko_KR.eucKR']
|
||||||
|
|
||||||
|
oldlocale = setlocale(LC_NUMERIC)
|
||||||
|
try:
|
||||||
saw_locale = 0
|
saw_locale = 0
|
||||||
for loc in candidate_locales:
|
for loc in candidate_locales:
|
||||||
try:
|
try:
|
||||||
|
|
@ -32,3 +34,5 @@ for loc in candidate_locales:
|
||||||
print "%r != %r" % (nl_radixchar, li_radixchar)
|
print "%r != %r" % (nl_radixchar, li_radixchar)
|
||||||
if not saw_locale:
|
if not saw_locale:
|
||||||
raise ImportError, "None of the listed locales found"
|
raise ImportError, "None of the listed locales found"
|
||||||
|
finally:
|
||||||
|
setlocale(LC_NUMERIC, oldlocale)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue