summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-11-07 10:15:08 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-11-07 10:15:08 (GMT)
commit3bd56387360e0b5ab1930640d0c4830c7fd6de23 (patch)
treee874fb79ea2cb7210c4124367ae7bf9376320bcb /Lib
parent61b787e6dd00b1e6e24a12e2d5aa6e9fd1352663 (diff)
downloadcpython-3bd56387360e0b5ab1930640d0c4830c7fd6de23.zip
cpython-3bd56387360e0b5ab1930640d0c4830c7fd6de23.tar.gz
cpython-3bd56387360e0b5ab1930640d0c4830c7fd6de23.tar.bz2
Closes #13361: Raise correct exception type.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/logging/__init__.py2
-rw-r--r--Lib/test/test_logging.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py
index bea290e..7dacddb 100644
--- a/Lib/logging/__init__.py
+++ b/Lib/logging/__init__.py
@@ -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:
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index a022680..ab66596 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -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):