##// END OF EJS Templates
Fix bug: https://bugs.launchpad.net/ipython/+bug/269966 This fixes a long-standing and serious problem with long-running IPython sessions. Finally! Many thanks to John D. Hunter and Sameer D'Costa for the feedback, especially for Sameer's patch that finally put me on the right track for a clean solution.

File last commit:

r1856:2f5ba090
r1856:2f5ba090
Show More
tclass.py
26 lines | 613 B | text/x-python | PythonLexer
"""Simple script to instantiate a class for testing %run"""
import sys
# An external test will check that calls to f() work after %run
class foo: pass
def f():
return foo()
# We also want to ensure that while objects remain available for immediate
# access, objects from *previous* runs of the same script get collected, to
# avoid accumulating massive amounts of old references.
class C(object):
def __init__(self,name):
self.name = name
def __del__(self):
print 'Deleting object:',self.name
try:
name = sys.argv[1]
except IndexError:
pass
else:
c = C(name)