Issue #15219: Fix a reference leak when hashlib.new() is called with

invalid parameters.
This commit is contained in:
Amaury Forgeot d'Arc 2012-06-29 01:42:46 +02:00
parent 45f0d9835c
commit d958cc960f
3 changed files with 6 additions and 6 deletions

View file

@ -108,12 +108,8 @@ class HashLibTestCase(unittest.TestCase):
_algo.islower()]))
def test_unknown_hash(self):
try:
hashlib.new('spam spam spam spam spam')
except ValueError:
pass
else:
self.assertTrue(0 == "hashlib didn't reject bogus hash name")
self.assertRaises(ValueError, hashlib.new, 'spam spam spam spam spam')
self.assertRaises(TypeError, hashlib.new, 1)
def test_get_builtin_constructor(self):
get_builtin_constructor = hashlib.__dict__[