Skip to content

Commit 7b277ef

Browse files
authored
Merge pull request #3516 from BsAtHome/fix_pyconfig-in-pythonplugin2
Do not initialize python if already initialized
2 parents ccbda05 + f7b52c3 commit 7b277ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/emc/pythonplugin/python_plugin.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,9 @@ PythonPlugin::PythonPlugin(struct _inittab *inittab) :
327327
}
328328
}
329329
config.buffered_stdio = 0;
330-
Py_InitializeFromConfig(&config);
330+
if (!Py_IsInitialized()) {
331+
Py_InitializeFromConfig(&config);
332+
}
331333
PyConfig_Clear(&config);
332334
initialize();
333335
}

0 commit comments

Comments
 (0)