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
a56411e5
Commit
a56411e5
authored
Sep 11, 2014
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Plain Diff
Closes #22386: merged fix from 3.4.
parents
ee6c3c71
d1d4fbff
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 @
a56411e5
...
...
@@ -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 @
a56411e5
...
...
@@ -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 @
a56411e5
...
...
@@ -307,6 +307,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