Serhiy Storchaka added the comment: Here is backported to 3.3 patch. It includes:
1. Operates not with sys.modules['builtins'].__dict__ and sys.modules['sys'].__dict__, but with cached interp->builtins and interp->sysdict, because sys.modules['builtins'] and sys.modules['sys'] can be changed, but builtins and standard streams for builtins are retrieved from cached interp->builtins and interp->sysdict. 2. interp->builtins is restored to saved copy. 3. Backported test. Actually it passed with current code, but can prevent future bugs. I'm not sure about (2), but may be (1) should be applied. ---------- Added file: http://bugs.python.org/file34022/modules_cleanup-3.3.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19255> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com