Hi list,<br><br>A month and a half ago, I submitted patch 1644818 to the CPython Patch Tracker: <a href="https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1644818&group_id=5470">https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1644818&group_id=5470
</a><br><br>On several occassions I have been advised to mention the patch in this list, so here it is:<br><br>The problem: Importing built-in submodule extensions (e.g. PyQt4.QtCore and PyQt4.QtGui in my case) does not work. By built-in I mean statically linked against the Python executable.
<br><br>The cause: find_module in import.c only checks the module name (e.g. QtCore) against the built-in list, which should contain the full name (e.g. PyQt4.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.<br>
<br>Solution:
By moving the "is_builtin()" check to earlier in find_module and using the "fullname" variable 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.
<br><br>When I submitted the patch, I ran the regression tests and everything seemed Ok. Also, the patch is for Python-2.5, but it a month and a half ago it was applicable to the svn trunk with only a one-line offset.<br>
<br>As I am completely new to CPython development, perhaps this problem has already been discussed and/or fixed I may have done something incorrectly. Please let me know if that is the case.<br><br>Regards,<br>Miguel Lobo
<br>