Clean module dicts properly when unloading a script - works around a bug in Python 2.7.0 only

This commit is contained in:
David Sansome 2011-01-29 00:57:58 +00:00
parent bcc35ec29c
commit 618aec2c74
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ bool PythonScript::Unload() {
}
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());
}
PyEval_ReleaseLock();