Message288346
There are no guaranties. But in recent Python versions the order of finalising is more predicable. It is hard to reproduce a case when some builtins or sys member is not available (with some exceptions).
The order of clearing (see PyImport_Cleanup() in Python/import.c):
1. Clear builtins._ and selected sys members (in particular this breaks import). Restore standard IO streams.
2. Clear sys.modules and all modules that don't have external references.
3. Restore builtins to its initial state (in particular builtins.open no longer available).
4. Clear the content of still alive modules except sys and builtins.
5. Clear sys.
6. Clear builtins. |
|
Date |
User |
Action |
Args |
2017-02-22 09:30:18 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, vinay.sajip, vstinner, smurfix, r.david.murray, methane, yselivanov, JanVok |
2017-02-22 09:30:18 | serhiy.storchaka | set | messageid: <1487755818.49.0.0110802787039.issue26789@psf.upfronthosting.co.za> |
2017-02-22 09:30:18 | serhiy.storchaka | link | issue26789 messages |
2017-02-22 09:30:18 | serhiy.storchaka | create | |
|