mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #29220: Improved fix and test.
This commit is contained in:
parent
9da31f7274
commit
924aaae4c2
2 changed files with 16 additions and 3 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue