Closes #13361: Raise correct exception type.

This commit is contained in:
Vinay Sajip 2011-11-07 10:15:08 +00:00
parent 61b787e6dd
commit 3bd5638736
2 changed files with 2 additions and 2 deletions

View file

@ -1095,7 +1095,7 @@ class Manager(object):
"""
rv = None
if not isinstance(name, str):
raise ValueError('A logger name must be a string')
raise TypeError('A logger name must be a string')
_acquireLock()
try:
if name in self.loggerDict:

View file

@ -294,7 +294,7 @@ class BuiltinLevelsTest(BaseTest):
])
def test_invalid_name(self):
self.assertRaises(ValueError, logging.getLogger, any)
self.assertRaises(TypeError, logging.getLogger, any)
class BasicFilterTest(BaseTest):