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
61b787e6
Commit
61b787e6
authored
Nov 07, 2011
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Closes #13661: Check added for type of logger name.
parent
ebfaabd6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
Lib/logging/__init__.py
Lib/logging/__init__.py
+2
-0
Lib/test/test_logging.py
Lib/test/test_logging.py
+2
-0
No files found.
Lib/logging/__init__.py
View file @
61b787e6
...
...
@@ -1094,6 +1094,8 @@ class Manager(object):
placeholder to now point to the logger.
"""
rv
=
None
if
not
isinstance
(
name
,
str
):
raise
ValueError
(
'A logger name must be a string'
)
_acquireLock
()
try
:
if
name
in
self
.
loggerDict
:
...
...
Lib/test/test_logging.py
View file @
61b787e6
...
...
@@ -293,6 +293,8 @@ class BuiltinLevelsTest(BaseTest):
('INF.BADPARENT', 'INFO', '4'),
])
def test_invalid_name(self):
self.assertRaises(ValueError, logging.getLogger, any)
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