Patch #962487: Don't crash for empty locale names.
This commit is contained in:
parent
cc0f93233a
commit
c8ae31dcbd
|
@ -337,7 +337,7 @@ def getdefaultlocale(envvars=('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')):
|
|||
lookup = os.environ.get
|
||||
for variable in envvars:
|
||||
localename = lookup(variable,None)
|
||||
if localename is not None:
|
||||
if localename:
|
||||
break
|
||||
else:
|
||||
localename = 'C'
|
||||
|
|
Loading…
Reference in New Issue