• Guido van Rossum's avatar
    Moved clear_carefully() to _PyModule_Clear() in moduleobject.c · 05f9dce3
    Guido van Rossum yazdı
    (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.
    05f9dce3
import.c 48.6 KB