mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Closes #29220: Fixed regression in logging.getLevelName().
This commit is contained in:
parent
231d1f3439
commit
8b866d5429
2 changed files with 13 additions and 3 deletions
|
@ -131,9 +131,13 @@ 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 None:
|
||||
result = _nameToLevel.get(level)
|
||||
if result is None:
|
||||
result = "Level %s" % level
|
||||
return result
|
||||
|
||||
def addLevelName(level, levelName):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue