Closes #13361: Raise correct exception type.
This commit is contained in:
parent
74ab3440ba
commit
53703d9d72
|
@ -1008,7 +1008,7 @@ class Manager(object):
|
|||
"""
|
||||
rv = None
|
||||
if not isinstance(name, basestring):
|
||||
raise ValueError('A logger name must be string or Unicode')
|
||||
raise TypeError('A logger name must be string or Unicode')
|
||||
if isinstance(name, unicode):
|
||||
name = name.encode('utf-8')
|
||||
_acquireLock()
|
||||
|
|
|
@ -273,7 +273,7 @@ class BuiltinLevelsTest(BaseTest):
|
|||
])
|
||||
|
||||
def test_invalid_name(self):
|
||||
self.assertRaises(ValueError, logging.getLogger, any)
|
||||
self.assertRaises(TypeError, logging.getLogger, any)
|
||||
|
||||
class BasicFilterTest(BaseTest):
|
||||
|
||||
|
|
Loading…
Reference in New Issue