Patch #962487: Don't crash for empty locale names.

This commit is contained in:
Martin v. Löwis 2004-07-26 12:45:18 +00:00
parent cc0f93233a
commit c8ae31dcbd

View file

@ -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'