1
"""Test code for https://bugs.launchpad.net/ipython/+bug/239054
3
WARNING: this script exits IPython! It MUST be run in a subprocess.
5
When you run the following script from CPython it prints:
9
and creates the __del__.txt file
11
When you run it from IPython it prints:
14
When you exit() or Exit from IPython neothing is printed and no file is created
15
(the file thing is to make sure __del__ is really never called and not that
16
just the output is eaten).
18
Note that if you call %reset in IPython then everything is Ok.
20
IPython should do the equivalent of %reset and release all the references it
21
holds before exit. This behavior is important when working with binding objects
22
that rely on __del__. If the current behavior has some use case then I suggest
23
to add a configuration option to IPython to control it.
29
print 'object A deleted'
33
# Now, we force an exit, the caller will check that the del printout was given