mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-19 05:41:00 +00:00
Catch errors getting the default locale.
This commit is contained in:
parent
addbcfc54f
commit
5c18a7f8b2
1 changed files with 5 additions and 1 deletions
|
|
@ -134,7 +134,11 @@ def get_locale ():
|
|||
"""Search the default platform locale and norm it.
|
||||
@returns (locale, encoding)
|
||||
@rtype (string, string)"""
|
||||
loc, encoding = locale.getdefaultlocale()
|
||||
try:
|
||||
loc, encoding = locale.getdefaultlocale()
|
||||
except ValueError, msg:
|
||||
print >>sys.stderr, "Error getting default locale:", msg
|
||||
loc, encoding = None, None
|
||||
if loc is None:
|
||||
loc = "C"
|
||||
else:
|
||||
|
|
|
|||
Loading…
Reference in a new issue