summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-06-02 04:50:49 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-06-02 04:50:49 (GMT)
commit38d4d4a35b9f5ba10d0343d458dd97a2a2432dae (patch)
tree9855252be9c547a14da580570885eee6b0a37567 /Lib
parente152aab977c8cffff8879f1ad3029792185ae884 (diff)
downloadcpython-38d4d4a35b9f5ba10d0343d458dd97a2a2432dae.zip
cpython-38d4d4a35b9f5ba10d0343d458dd97a2a2432dae.tar.gz
cpython-38d4d4a35b9f5ba10d0343d458dd97a2a2432dae.tar.bz2
Fix memory leak found by valgrind.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_exceptions.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_exceptions.py b/Lib/test/test_exceptions.py
index 8bd385a..84d2798 100644
--- a/Lib/test/test_exceptions.py
+++ b/Lib/test/test_exceptions.py
@@ -265,7 +265,9 @@ class ExceptionTests(unittest.TestCase):
if (e is not exc and # needed for sampleUnicode errors
type(e) is not exc):
raise
- for checkArgName in expected.keys():
+ # Verify no ref leaks in Exc_str()
+ s = str(e)
+ for checkArgName in expected:
self.assertEquals(repr(getattr(e, checkArgName)),
repr(expected[checkArgName]),
'exception "%s", attribute "%s"' %
@@ -273,7 +275,7 @@ class ExceptionTests(unittest.TestCase):
# test for pickling support
new = pickle.loads(pickle.dumps(e, random.randint(0, 2)))
- for checkArgName in expected.keys():
+ for checkArgName in expected:
self.assertEquals(repr(getattr(e, checkArgName)),
repr(expected[checkArgName]),
'pickled exception "%s", attribute "%s' %