Merged fix for #13361 from 3.2.

This commit is contained in:
Vinay Sajip 2011-11-07 08:53:58 +00:00
commit 39b53c50c4
2 changed files with 4 additions and 0 deletions

View File

@ -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:

View File

@ -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):