mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
Closes #13661: Check added for type of logger name.
This commit is contained in:
parent
ebfaabd663
commit
61b787e6dd
@ -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:
|
||||
|
@ -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):
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user