Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d1d4fbff
Commit
d1d4fbff
authored
Sep 11, 2014
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22386: fixed regression.
parent
42d67af8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
Doc/library/logging.rst
Doc/library/logging.rst
+2
-2
Lib/logging/__init__.py
Lib/logging/__init__.py
+2
-1
Lib/test/test_logging.py
Lib/test/test_logging.py
+4
-0
No files found.
Doc/library/logging.rst
View file @
d1d4fbff
...
...
@@ -1052,8 +1052,8 @@ functions.
..
versionchanged
::
3.4
In
Python
versions
earlier
than
3.4
,
this
function
could
also
be
passed
a
text
level
,
and
would
return
the
corresponding
numeric
value
of
the
level
.
This
undocumented
behaviour
was
a
mistake
,
and
has
been
removed
in
Pytho
n
3.4
.
This
undocumented
behaviour
was
considered
a
mistake
,
and
was
removed
i
n
Python
3.4
,
but
reinstated
in
3.4.2
due
to
retain
backward
compatibility
.
..
function
::
makeLogRecord
(
attrdict
)
...
...
Lib/logging/__init__.py
View file @
d1d4fbff
...
...
@@ -129,7 +129,8 @@ def getLevelName(level):
Otherwise, the string "Level %s" % level is returned.
"""
return
_levelToName
.
get
(
level
,
(
"Level %s"
%
level
))
# See Issue #22386 for the reason for this convoluted expression
return
_levelToName
.
get
(
level
,
_nameToLevel
.
get
(
level
,
(
"Level %s"
%
level
)))
def
addLevelName
(
level
,
levelName
):
"""
...
...
Lib/test/test_logging.py
View file @
d1d4fbff
...
...
@@ -313,6 +313,10 @@ class BuiltinLevelsTest(BaseTest):
('INF.BADPARENT', 'INFO', '4'),
])
def test_regression_22386(self):
"""See issue #22386 for more information."""
self.assertEqual(logging.getLevelName('INFO'), logging.INFO)
self.assertEqual(logging.getLevelName(logging.INFO), 'INFO')
class BasicFilterTest(BaseTest):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment