mirror of
https://github.com/python/cpython
synced 2024-10-19 01:23:28 +00:00
Get rid of memory leak caused by assingning sys.exc_info() to a local.
Store sys.exc_info()[:2] instead.
This commit is contained in:
parent
1cb6cd0ec5
commit
6650320349
|
@ -16,7 +16,7 @@ def test(method, input, output, *args):
|
||||||
value = apply(f, args)
|
value = apply(f, args)
|
||||||
except:
|
except:
|
||||||
value = sys.exc_type
|
value = sys.exc_type
|
||||||
exc = sys.exc_info()
|
exc = sys.exc_info()[:2]
|
||||||
else:
|
else:
|
||||||
exc = None
|
exc = None
|
||||||
if value != output:
|
if value != output:
|
||||||
|
@ -24,7 +24,7 @@ def test(method, input, output, *args):
|
||||||
print 'no'
|
print 'no'
|
||||||
print '*',f, `input`, `output`, `value`
|
print '*',f, `input`, `output`, `value`
|
||||||
if exc:
|
if exc:
|
||||||
print ' value == %s: %s' % (exc[:2])
|
print ' value == %s: %s' % (exc)
|
||||||
else:
|
else:
|
||||||
if verbose:
|
if verbose:
|
||||||
print 'yes'
|
print 'yes'
|
||||||
|
|
Loading…
Reference in a new issue