Closes #13361: Raise correct exception type.

This commit is contained in:
Vinay Sajip 2011-11-07 10:13:18 +00:00
parent 74ab3440ba
commit 53703d9d72
2 changed files with 2 additions and 2 deletions

View File

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

View File

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