]> granicus.if.org Git - python/commit
Moved clear_carefully() to _PyModule_Clear() in moduleobject.c
authorGuido van Rossum <guido@python.org>
Thu, 19 Feb 1998 20:58:44 +0000 (20:58 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 19 Feb 1998 20:58:44 +0000 (20:58 +0000)
commit05f9dce34f3a91e1a9d69e3e85c93c506e0cc6ba
treebb7c62cd1102037ed02bb70378e5616cf98bb210
parentbd36dbaaa53929e1bd8609e734c7a0fa128b7bd2
Moved clear_carefully() to _PyModule_Clear() in moduleobject.c
(modified) and use that.

Some differences in the cleanup algorithm:

- Clear __main__ before the other modules.

- Delete more sys variables: including ps1, ps2, exitfunc, argv, and
even path -- this will prevent new imports!

- Restore stdin, stdout, stderr from __stdin__, __stdout__,
__stderr__, effectively deleting hooks that the user might have
installed -- so their (the hooks') destructors will run.
Python/import.c