X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=srd.c;h=c74d2ded7d5c65d845e2f84858a41f932c1fd158;hb=366580f2617432561b0a93bc32e56f83895a7e48;hp=7b18c9a4dfa2a6ded230005f452a611f0094c4bb;hpb=40c6ac1d3fbded276dcbff23e8bc099896ab2fb5;p=libsigrokdecode.git diff --git a/srd.c b/srd.c index 7b18c9a..c74d2de 100644 --- a/srd.c +++ b/srd.c @@ -157,7 +157,7 @@ SRD_API int srd_init(const char *path) PyImport_AppendInittab("sigrokdecode", PyInit_sigrokdecode); /* Initialize the Python interpreter. */ - Py_Initialize(); + Py_InitializeEx(0); /* Locations relative to the XDG system data directories. */ sys_datadirs = g_get_system_data_dirs(); @@ -169,6 +169,12 @@ SRD_API int srd_init(const char *path) } } #ifdef DECODERS_DIR + /* Common modules for use by any decoder. */ + if ((ret = srd_decoder_searchpath_add(COMMON_DIR)) != SRD_OK) { + Py_Finalize(); + return ret; + } + /* Hardcoded decoders install location, if defined. */ if ((ret = srd_decoder_searchpath_add(DECODERS_DIR)) != SRD_OK) { Py_Finalize();