summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2015-09-05 11:05:05 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2015-09-05 11:05:05 (GMT)
commit9d3c61c86a20678d604c96a68bbf4a966877f0b9 (patch)
tree77e38b72e9258da435606d28543cc0362787eeff /Modules
parent1b6691053701e92490c6b68171d6d6a645f8e708 (diff)
downloadcpython-9d3c61c86a20678d604c96a68bbf4a966877f0b9.zip
cpython-9d3c61c86a20678d604c96a68bbf4a966877f0b9.tar.gz
cpython-9d3c61c86a20678d604c96a68bbf4a966877f0b9.tar.bz2
Close #24748: Restore imp.load_dynamic compatibility
To resolve a compatibility problem found with py2exe and pywin32, imp.load_dynamic() once again ignores previously loaded modules to support Python modules replacing themselves with extension modules. Patch by Petr Viktorin.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testmultiphase.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Modules/_testmultiphase.c b/Modules/_testmultiphase.c
index 2919687..2005205 100644
--- a/Modules/_testmultiphase.c
+++ b/Modules/_testmultiphase.c
@@ -582,3 +582,13 @@ PyInit__testmultiphase_exec_unreported_exception(PyObject *spec)
{
return PyModuleDef_Init(&def_exec_unreported_exception);
}
+
+/*** Helper for imp test ***/
+
+static PyModuleDef imp_dummy_def = TEST_MODULE_DEF("imp_dummy", main_slots, testexport_methods);
+
+PyMODINIT_FUNC
+PyInit_imp_dummy(PyObject *spec)
+{
+ return PyModuleDef_Init(&imp_dummy_def);
+}