File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -293,11 +293,17 @@ PythonPlugin::PythonPlugin(struct _inittab *inittab) :
293293 abs_path(0 ),
294294 log_level(0 )
295295{
296+ #if PY_VERSION_HEX >= 0x030800f0
296297 PyConfig config;
297298 PyConfig_InitPythonConfig (&config);
299+ #endif
298300 if (abs_path) {
299301 wchar_t *program = Py_DecodeLocale (abs_path, NULL );
302+ #if PY_VERSION_HEX >= 0x030800f0
300303 PyConfig_SetString (&config, &config.program_name , program);
304+ #else
305+ Py_SetProgramName (program);
306+ #endif
301307 }
302308 if (inittab != NULL ) {
303309 if (!Py_IsInitialized ()) {
@@ -325,9 +331,14 @@ PythonPlugin::PythonPlugin(struct _inittab *inittab) :
325331 }
326332 }
327333 }
334+ #if PY_VERSION_HEX >= 0x030800f0
328335 config.buffered_stdio = 0 ;
329336 Py_InitializeFromConfig (&config);
330337 PyConfig_Clear (&config);
338+ #else
339+ Py_UnbufferedStdioFlag = 1 ;
340+ Py_Initialize ();
341+ #endif
331342 initialize ();
332343}
333344
Original file line number Diff line number Diff line change @@ -208,12 +208,16 @@ int main(int argc, char **argv)
208208 PyObject * pModule , * pFunc , * pPeriodicFunc , * pClass ;
209209 char name [] = "panelui" ;
210210 wchar_t * wname = Py_DecodeLocale (name , NULL );
211+ #if PY_VERSION_HEX >= 0x030800f0
211212 PyConfig config ;
212213 PyConfig_InitPythonConfig (& config );
213214 PyConfig_SetString (& config , & config .program_name , wname );
214215 Py_InitializeFromConfig (& config );
215216 PyConfig_Clear (& config );
216-
217+ #else
218+ Py_SetProgramName (wname );
219+ Py_Initialize ();
220+ #endif
217221 PyRun_SimpleString ("import pyui\n"
218222 "pyui.instance = pyui.master.keyboard()\n"
219223 "pyui.exit_funct = pyui.instance.exit\n"
You can’t perform that action at this time.
0 commit comments