Commit 3bd56387 authored by Vinay Sajip's avatar Vinay Sajip

Closes #13361: Raise correct exception type.

parent 61b787e6
...@@ -1095,7 +1095,7 @@ class Manager(object): ...@@ -1095,7 +1095,7 @@ class Manager(object):
""" """
rv = None rv = None
if not isinstance(name, str): if not isinstance(name, str):
raise ValueError('A logger name must be a string') raise TypeError('A logger name must be a string')
_acquireLock() _acquireLock()
try: try:
if name in self.loggerDict: if name in self.loggerDict:
......
...@@ -294,7 +294,7 @@ class BuiltinLevelsTest(BaseTest): ...@@ -294,7 +294,7 @@ class BuiltinLevelsTest(BaseTest):
]) ])
def test_invalid_name(self): def test_invalid_name(self):
self.assertRaises(ValueError, logging.getLogger, any) self.assertRaises(TypeError, logging.getLogger, any)
class BasicFilterTest(BaseTest): 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