diff options
-rw-r--r-- | Lib/hashlib.py | 2 | ||||
-rw-r--r-- | Lib/test/test_hashlib.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/hashlib.py b/Lib/hashlib.py index 91080955dd..21454c7d30 100644 --- a/Lib/hashlib.py +++ b/Lib/hashlib.py @@ -88,7 +88,7 @@ def __get_builtin_constructor(name): except ImportError: pass # no extension module, this hash is unsupported. - raise ValueError('unsupported hash type %s' % name) + raise ValueError('unsupported hash type ' + name) def __get_openssl_constructor(name): diff --git a/Lib/test/test_hashlib.py b/Lib/test/test_hashlib.py index d2ef9d1f3f..32f85e9b48 100644 --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -133,6 +133,7 @@ class HashLibTestCase(unittest.TestCase): sys.modules['_md5'] = _md5 else: del sys.modules['_md5'] + self.assertRaises(TypeError, get_builtin_constructor, 3) def test_hexdigest(self): for name in self.supported_hash_names: |