]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport revision 2.69.
authorGuido van Rossum <guido@python.org>
Tue, 15 Jan 2002 21:14:38 +0000 (21:14 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 15 Jan 2002 21:14:38 +0000 (21:14 +0000)
commita472771dadd1e17a019f5effc8877ba20d914c56
tree6a104975500c97fea39a1bee05c4cbb25c311cba
parente60d3737ded2ec70bc291cd1cae5b5890866b6bd
Backport revision 2.69.

SF patch #471839: Bug when extensions import extensions (Shane Hathaway)

    When an extension imports another extension in its
    initXXX() function, the variable _Py_PackageContext is
    prematurely reset to NULL. If the outer extension then
    calls Py_InitModule(), the extension is installed in
    sys.modules without its package name. The
    manifestation of this bug is a "SystemError:
    _PyImport_FixupExtension: module <package>.<extension>
    not loaded".

    To fix this, importdl.c just needs to retain the old
    value of _Py_PackageContext and restore it after the
    initXXX() method is called. The attached patch does this.

    This patch applies to Python 2.1.1 and the current CVS.
Python/importdl.c