gh-141169: Re-raise exception from findfuncptr (GH-141349)

This commit is contained in:
Petr Viktorin 2025-11-11 13:52:13 +01:00 committed by GitHub
parent d69447445c
commit 799326b0a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 31 additions and 25 deletions

View file

@ -10,27 +10,6 @@
#include "pycore_runtime.h" // _Py_ID()
/* ./configure sets HAVE_DYNAMIC_LOADING if dynamic loading of modules is
supported on this platform. configure will then compile and link in one
of the dynload_*.c files, as appropriate. We will call a function in
those modules to get a function pointer to the module's init function.
*/
#ifdef HAVE_DYNAMIC_LOADING
#ifdef MS_WINDOWS
extern dl_funcptr _PyImport_FindSharedFuncptrWindows(const char *prefix,
const char *shortname,
PyObject *pathname,
FILE *fp);
#else
extern dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
const char *shortname,
const char *pathname, FILE *fp);
#endif
#endif /* HAVE_DYNAMIC_LOADING */
/***********************************/
/* module info to use when loading */
/***********************************/
@ -414,6 +393,9 @@ _PyImport_GetModuleExportHooks(
*modexport = (PyModExportFunction)exportfunc;
return 2;
}
if (PyErr_Occurred()) {
return -1;
}
exportfunc = findfuncptr(
info->hook_prefixes->init_prefix,