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
1 changed files with 1 additions and 1 deletions

View File

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