1 diff --git a/srd.c b/srd.c
2 index f5b885f..1599957 100644
5 @@ -140,16 +140,32 @@ SRD_API int srd_init(const char *path)
6 /* Add our own module to the list of built-in modules. */
7 PyImport_AppendInittab("sigrokdecode", PyInit_sigrokdecode);
10 + * MinGW: Hardcode the frontend's install dir as PYTHONHOME.
11 + * The NSIS installers will place python*.dll and python*.zip (which
12 + * contains all required libs and Python modules) there.
14 + * Also hardcode that only the Python stdlib and the libsigrokdecode
15 + * PDs in the 'decoders' subdirectory in the frontend's install
16 + * directory are ever used/found by Python. This avoids various issues
17 + * with other Python libs and modules installed on the same system.
20 /* Initialize the Python interpreter. */
21 + Py_SetPythonHome(L".");
23 + PyRun_SimpleString("import sys; sys.path = ['python32.zip']");
26 /* Installed decoders. */
27 if ((ret = srd_decoder_searchpath_add(DECODERS_DIR)) != SRD_OK) {
33 /* Path specified by the user. */
36 if ((ret = srd_decoder_searchpath_add(path)) != SRD_OK) {