diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-11-07 10:13:18 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-11-07 10:13:18 (GMT) |
commit | 53703d9d72c4b48a8c602209c4e4aba15f48d238 (patch) | |
tree | f57245020fbd9c96a3f2f6d1a8090782323df88f | |
parent | 74ab3440bad1b97e39fb5adf992e555ba26001d1 (diff) | |
download | cpython-53703d9d72c4b48a8c602209c4e4aba15f48d238.zip cpython-53703d9d72c4b48a8c602209c4e4aba15f48d238.tar.gz cpython-53703d9d72c4b48a8c602209c4e4aba15f48d238.tar.bz2 |
Closes #13361: Raise correct exception type.
-rw-r--r-- | Lib/logging/__init__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_logging.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index a0c4cb7..dad69ae 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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() diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index b2d0a2b..2aac360 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -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): |