Changeset View
Changeset View
Standalone View
Standalone View
scripting/python_scripter.cc
Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Line(s) | 397 | #endif | |||
---|---|---|---|---|---|
423 | handle<> mnh(borrowed( PyModule_GetDict(main_module.get()) )); | 423 | handle<> mnh(borrowed( PyModule_GetDict(main_module.get()) )); | ||
424 | d->mainnamespace = extract<dict>( mnh.get() ); | 424 | d->mainnamespace = extract<dict>( mnh.get() ); | ||
425 | } | 425 | } | ||
426 | 426 | | |||
427 | PythonScripter::~PythonScripter() | 427 | PythonScripter::~PythonScripter() | ||
428 | { | 428 | { | ||
429 | PyErr_Clear(); | 429 | PyErr_Clear(); | ||
430 | delete d; | 430 | delete d; | ||
431 | Py_FinalizeEx(); | 431 | // Py_FinalizeEx(); | ||
wbauer: This breaks the build with python2 though.
Maybe add a conditional like it's done in https… | |||||
Actually Py_Finalze() should still work for compatibility reasons in python3, so we could simply paolini: Actually Py_Finalze() should still work for compatibility reasons in python3, so we could… | |||||
I saw now that Py_FinalizeEx() exists only since python version 3.6. But yes, it's probably best to just switch back to Py_Finalize(), I suppose. The return value is not checked anyway. wbauer: I saw now that Py_FinalizeEx() exists only since python version 3.6.
So this should be changed… | |||||
432 | Py_Finalize(); // maintained for compatibility reasons with python2 | ||||
432 | } | 433 | } | ||
433 | 434 | | |||
434 | class CompiledPythonScript::Private | 435 | class CompiledPythonScript::Private | ||
435 | { | 436 | { | ||
436 | public: | 437 | public: | ||
437 | int ref; | 438 | int ref; | ||
438 | object calcfunc; | 439 | object calcfunc; | ||
439 | // TODO | 440 | // TODO | ||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |
This breaks the build with python2 though.
Maybe add a conditional like it's done in https://cgit.kde.org/kig.git/commit/?id=c0aa768f28219ce8b3c275a6d13ad69757e3c7af ?