This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mlobo
Recipients
Date 2007-01-25.22:12:30
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
At the moment importing built-in submodules (in my case PyQt4.QtCore and PyQt4.QtGui) does not work.  This seems to be because find_module in import.c checks only the module name (e.g. QtCore) against the built-in list, which should contain the full name (e.g. Python.QtCore) instead.

Also, the above check is performed after the code to check if the parent module is frozen, which would have already exited in that case.

By moving the is_builtin() check to earlier in find_module and using fullname instead of name, I can build PyQt4.QtCore and PyQt4.QtGui into the interpreter and import and use them with no problem whatsoever, even if their parent module (PyQt4) is frozen.

I have run the regression tests and everything seems Ok.

I am completely new to CPython development so it is quite possible that my solution is undesirable or that I have done something incorrectly.  Please let me know if that is the case.

Finally, the attached patch is for Python-2.5, but I have checked it also applies to current svn trunk with only a one-line offset.
History
Date User Action Args
2007-08-23 15:56:24adminlinkissue1644818 messages
2007-08-23 15:56:24admincreate