Skip to content

Commit 258e0b5

Browse files
BsAtHomermu75
authored andcommitted
Only initialize python if not yet initialized.
1 parent 9462e0e commit 258e0b5

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
@@ -333,7 +333,9 @@ PythonPlugin::PythonPlugin(struct _inittab *inittab) :
333333
}
334334
#if PY_VERSION_HEX >= 0x030800f0
335335
config.buffered_stdio = 0;
336-
Py_InitializeFromConfig(&config);
336+
if (!Py_IsInitialized()) {
337+
Py_InitializeFromConfig(&config);
338+
}
337339
PyConfig_Clear(&config);
338340
#else
339341
Py_UnbufferedStdioFlag = 1;

0 commit comments

Comments
 (0)