]> granicus.if.org Git - python/commitdiff
Get rid of memory leak caused by assingning sys.exc_info() to a local.
authorGuido van Rossum <guido@python.org>
Fri, 28 Apr 2000 20:39:58 +0000 (20:39 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 28 Apr 2000 20:39:58 +0000 (20:39 +0000)
Store sys.exc_info()[:2] instead.

Lib/test/test_unicode.py

index 94b2a4f312ca2645e9433f63d909ab10fa7800a9..45449ee67b7c15f49f1beb23bd47c70f0f61605e 100644 (file)
@@ -16,7 +16,7 @@ def test(method, input, output, *args):
         value = apply(f, args)
     except:
         value = sys.exc_type
-        exc = sys.exc_info()
+        exc = sys.exc_info()[:2]
     else:
         exc = None
     if value != output:
@@ -24,7 +24,7 @@ def test(method, input, output, *args):
             print 'no'
         print '*',f, `input`, `output`, `value`
         if exc:
-            print '  value == %s: %s' % (exc[:2])
+            print '  value == %s: %s' % (exc)
     else:
         if verbose:
             print 'yes'