Issue #29220: Improved fix and test.

This commit is contained in:
Vinay Sajip 2017-01-11 17:35:36 +00:00
parent 9da31f7274
commit 924aaae4c2
2 changed files with 16 additions and 3 deletions

View file

@ -129,9 +129,14 @@ def getLevelName(level):
Otherwise, the string "Level %s" % level is returned.
"""
# See Issues #22386 and #27937 for why it's this way
return (_levelToName.get(level) or _nameToLevel.get(level) or
"Level %s" % level)
# See Issues #22386, #27937 and #29220 for why it's this way
result = _levelToName.get(level)
if result is not None:
return result
result = _nameToLevel.get(level)
if result is not None:
return result
return "Level %s" % level
def addLevelName(level, levelName):
"""