diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-11 17:41:28 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2017-01-11 17:41:28 (GMT) |
commit | a861d48817e2477cd0b5189787d071ff01dbe4f7 (patch) | |
tree | 89456854592b24448c412518c399a0f9f3bc666d /Lib/logging | |
parent | ced4b90756e58a8ad99f64fb2c7a3e83f49cf017 (diff) | |
parent | 924aaae4c2a99015ca6b448f16eed31bbb598b98 (diff) | |
download | cpython-a861d48817e2477cd0b5189787d071ff01dbe4f7.zip cpython-a861d48817e2477cd0b5189787d071ff01dbe4f7.tar.gz cpython-a861d48817e2477cd0b5189787d071ff01dbe4f7.tar.bz2 |
Issue #292Merged fixes from 3.5.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 2590d65..b44a3b2 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -131,9 +131,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): """ |