Commit 7a649b37 authored by Vinay Sajip's avatar Vinay Sajip

Closes #13361: Raise correct exception type.

parent 9a47d8e5
......@@ -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):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment