mirror of
https://github.com/cemu-project/idapython.git
synced 2025-01-14 10:59:13 +01:00
bugfix: idaapi.enable_extlang_python() could not be called from init.py
This commit is contained in:
parent
2d763844ed
commit
930b333d3b
@ -1207,7 +1207,7 @@ bool IDAPython_Init(void)
|
||||
char tmp[MAXSTR+64];
|
||||
#ifdef __LINUX__
|
||||
// Export symbols from libpython to resolve imported module deps
|
||||
qsnprintf(tmp, sizeof(tmp), "libpython%d.%d.so",
|
||||
qsnprintf(tmp, sizeof(tmp), "libpython%d.%d.so.1",
|
||||
PY_MAJOR_VERSION,
|
||||
PY_MINOR_VERSION);
|
||||
if ( !dlopen(tmp, RTLD_NOLOAD | RTLD_GLOBAL | RTLD_LAZY) )
|
||||
@ -1259,6 +1259,10 @@ bool IDAPython_Init(void)
|
||||
VER_SERIAL);
|
||||
PyRun_SimpleString(tmp);
|
||||
|
||||
// Install extlang. Needs to be done before running init.py
|
||||
// in case it's calling idaapi.enable_extlang_python(1)
|
||||
install_extlang(&extlang_python);
|
||||
|
||||
// Execute init.py (for Python side initialization)
|
||||
qmakepath(tmp, MAXSTR, g_idapython_dir, "init.py", NULL);
|
||||
if ( !PyRunFile(tmp) )
|
||||
@ -1299,9 +1303,6 @@ bool IDAPython_Init(void)
|
||||
// Enable the CLI by default
|
||||
enable_python_cli(true);
|
||||
|
||||
// Install extlang
|
||||
install_extlang(&extlang_python);
|
||||
|
||||
g_initialized = true;
|
||||
pywraps_nw_notify(NW_INITIDA_SLOT);
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user