mirror of
https://github.com/python/cpython.git
synced 2025-11-12 07:02:33 +00:00
Merged fix for #13361 from 3.2.
This commit is contained in:
commit
39b53c50c4
2 changed files with 4 additions and 0 deletions
|
|
@ -1096,6 +1096,8 @@ class Manager(object):
|
||||||
placeholder to now point to the logger.
|
placeholder to now point to the logger.
|
||||||
"""
|
"""
|
||||||
rv = None
|
rv = None
|
||||||
|
if not isinstance(name, str):
|
||||||
|
raise ValueError('A logger name must be a string')
|
||||||
_acquireLock()
|
_acquireLock()
|
||||||
try:
|
try:
|
||||||
if name in self.loggerDict:
|
if name in self.loggerDict:
|
||||||
|
|
|
||||||
|
|
@ -310,6 +310,8 @@ class BuiltinLevelsTest(BaseTest):
|
||||||
('INF.BADPARENT', 'INFO', '4'),
|
('INF.BADPARENT', 'INFO', '4'),
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def test_invalid_name(self):
|
||||||
|
self.assertRaises(ValueError, logging.getLogger, any)
|
||||||
|
|
||||||
class BasicFilterTest(BaseTest):
|
class BasicFilterTest(BaseTest):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue