Kaydet (Commit) 3bd56387 authored tarafından Vinay Sajip's avatar Vinay Sajip

Closes #13361: Raise correct exception type.

üst 61b787e6
......@@ -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:
......
......@@ -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):
......
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