Fixes #27937: optimise code used in all logging calls.

This commit is contained in:
Vinay Sajip 2016-09-03 15:56:07 +01:00
parent 6e025608a2
commit 0a7b7e30ff
1 changed files with 3 additions and 2 deletions

View File

@ -130,8 +130,9 @@ def getLevelName(level):
Otherwise, the string "Level %s" % level is returned.
"""
# See Issue #22386 for the reason for this convoluted expression
return _levelToName.get(level, _nameToLevel.get(level, ("Level %s" % level)))
# See Issues #22386 and #27937 for why it's this way
return (_levelToName.get(level) or _nameToLevel.get(level) or
"Level %s" % level)
def addLevelName(level, levelName):
"""