fix a bug in PythonPlugin