setlocale: fallback si locale manquante
This commit is contained in:
parent
438a4d5428
commit
3ac91b56e7
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,9 @@ def setlocale(name):
|
||||||
saved = locale.setlocale(locale.LC_ALL)
|
saved = locale.setlocale(locale.LC_ALL)
|
||||||
try:
|
try:
|
||||||
yield locale.setlocale(locale.LC_ALL, name)
|
yield locale.setlocale(locale.LC_ALL, name)
|
||||||
|
except:
|
||||||
|
yield saved
|
||||||
|
print "Warning: Failed setting locale %r" % name
|
||||||
finally:
|
finally:
|
||||||
locale.setlocale(locale.LC_ALL, saved)
|
locale.setlocale(locale.LC_ALL, saved)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue