Issue #24268: Fix import naming when loading extension modules. Patch by Petr Viktorin.
This commit is contained in:
parent
c7792160dd
commit
adc2fb8a6a
|
@ -18,6 +18,6 @@ dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
|
||||||
{
|
{
|
||||||
char funcname[258];
|
char funcname[258];
|
||||||
|
|
||||||
PyOS_snprintf(funcname, sizeof(funcname), "%20s_%.200s", prefix, shortname);
|
PyOS_snprintf(funcname, sizeof(funcname), "%.20s_%.200s", prefix, shortname);
|
||||||
return dl_loadmod(Py_GetProgramName(), pathname, funcname);
|
return dl_loadmod(Py_GetProgramName(), pathname, funcname);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
#include "importdl.h"
|
#include "importdl.h"
|
||||||
|
|
||||||
#if defined(__hp9000s300)
|
#if defined(__hp9000s300)
|
||||||
#define FUNCNAME_PATTERN "_%20s_%.200s"
|
#define FUNCNAME_PATTERN "_%.20s_%.200s"
|
||||||
#else
|
#else
|
||||||
#define FUNCNAME_PATTERN "%20s_%.200s"
|
#define FUNCNAME_PATTERN "%.20s_%.200s"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *_PyImport_DynLoadFiletab[] = {SHLIB_EXT, NULL};
|
const char *_PyImport_DynLoadFiletab[] = {SHLIB_EXT, NULL};
|
||||||
|
|
|
@ -40,7 +40,7 @@ dl_funcptr _PyImport_FindSharedFuncptr(const char *prefix,
|
||||||
const char *errString;
|
const char *errString;
|
||||||
char errBuf[512];
|
char errBuf[512];
|
||||||
|
|
||||||
PyOS_snprintf(funcname, sizeof(funcname), "_%20s_%.200s", prefix, shortname);
|
PyOS_snprintf(funcname, sizeof(funcname), "_%.20s_%.200s", prefix, shortname);
|
||||||
|
|
||||||
#ifdef USE_DYLD_GLOBAL_NAMESPACE
|
#ifdef USE_DYLD_GLOBAL_NAMESPACE
|
||||||
if (NSIsSymbolNameDefined(funcname)) {
|
if (NSIsSymbolNameDefined(funcname)) {
|
||||||
|
|
Loading…
Reference in New Issue