mirror of https://github.com/python/cpython
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
|
lookup = os.environ.get
|
||||||
for variable in envvars:
|
for variable in envvars:
|
||||||
localename = lookup(variable,None)
|
localename = lookup(variable,None)
|
||||||
if localename is not None:
|
if localename:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
localename = 'C'
|
localename = 'C'
|
||||||
|
|
Loading…
Reference in New Issue