Clean module dicts properly when unloading a script - works around a bug in Python 2.7.0 only
This commit is contained in:
parent
bcc35ec29c
commit
618aec2c74
|
@ -109,6 +109,9 @@ bool PythonScript::Unload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (const QString& key, keys_to_delete) {
|
foreach (const QString& key, keys_to_delete) {
|
||||||
|
// Workaround Python issue 10068 (only affects 2.7.0)
|
||||||
|
_PyModule_Clear(PyDict_GetItemString(modules, key.toAscii().constData()));
|
||||||
|
|
||||||
PyDict_DelItemString(modules, key.toAscii().constData());
|
PyDict_DelItemString(modules, key.toAscii().constData());
|
||||||
}
|
}
|
||||||
PyEval_ReleaseLock();
|
PyEval_ReleaseLock();
|
||||||
|
|
Loading…
Reference in New Issue