[issue1576] First draft of a post import hook

2007-12-10 Thread Christian Heimes
Christian Heimes added the comment: UPDATES: * no ref leaks * PyModule_IsLazy(mod) checks mod.__lazy_import__ attribute (we can argue about a nice name later) * Added imp.is_lazy(mod_or_name) Added file: http://bugs.python.org/file8914/py3k_post_import_hook4.patch _

[issue1576] First draft of a post import hook

2007-12-10 Thread Christian Heimes
Changes by Christian Heimes: Removed file: http://bugs.python.org/file8906/py3k_post_import_hook2.patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bug

[issue1576] First draft of a post import hook

2007-12-10 Thread Christian Heimes
Christian Heimes added the comment: The new patch fixes some ref leaks, corner cases and adds some new unit tests. All unit tests are passing but I'm leaking lots of references in the register function. Added file: http://bugs.python.org/file8909/py3k_post_import_hook3.patch ___

[issue1576] First draft of a post import hook

2007-12-09 Thread Christian Heimes
Changes by Christian Heimes: Removed file: http://bugs.python.org/file8900/py3k_post_import_hook.patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs

[issue1576] First draft of a post import hook

2007-12-09 Thread Christian Heimes
Christian Heimes added the comment: I've moved the result = PyImport_NotifyPostImport(result); inside the protected block. It's now protected by the import lock. I've also added the lock protection to the register function. The notify method is now exposed through the imp module, too. I've chec

[issue1576] First draft of a post import hook

2007-12-09 Thread Phillip J. Eby
Phillip J. Eby added the comment: It also needs to hold the import lock during both the "register" and "notify" operations. In addition, the "notify" operation needs to be exposed for calling from Python (so that lazy module implementations can interop). Finally, it's not clear to me whether

[issue1576] First draft of a post import hook

2007-12-09 Thread Christian Heimes
New submission from Christian Heimes: I've written a rough draft for a post import hook as discussed on the python 3000 mailing list. The implementation is far from perfect. It requires more unit tests, a code review and reference count checks. -- assignee: tiran components: Interpreter