diff --git a/pcbnew/scripting/pcbnew_footprint_wizards.cpp b/pcbnew/scripting/pcbnew_footprint_wizards.cpp index 5f3c4345dc..4823eee294 100644 --- a/pcbnew/scripting/pcbnew_footprint_wizards.cpp +++ b/pcbnew/scripting/pcbnew_footprint_wizards.cpp @@ -171,7 +171,7 @@ wxString PYTHON_FOOTPRINT_WIZARD::GetParameterPageName( int aPage ) PyLOCK lock; // Time to call the callback - PyObject* arglist = Py_BuildValue( "( i )", aPage ); + PyObject* arglist = Py_BuildValue( "(i)", aPage ); PyObject* result = CallMethod( "GetParameterPageName", arglist ); Py_DECREF( arglist ); @@ -191,7 +191,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterNames( int aPage ) wxArrayString ret; PyLOCK lock; - PyObject* arglist = Py_BuildValue( "( i )", aPage ); + PyObject* arglist = Py_BuildValue( "(i)", aPage ); ret = CallRetArrayStrMethod( "GetParameterNames", arglist ); Py_DECREF( arglist ); @@ -214,7 +214,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterTypes( int aPage ) wxArrayString ret; PyLOCK lock; - PyObject* arglist = Py_BuildValue( "( i )", aPage ); + PyObject* arglist = Py_BuildValue( "(i)", aPage ); ret = CallRetArrayStrMethod( "GetParameterNames", arglist ); Py_DECREF( arglist ); @@ -240,7 +240,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterValues( int aPage ) { PyLOCK lock; - PyObject* arglist = Py_BuildValue( "( i )", aPage ); + PyObject* arglist = Py_BuildValue( "(i)", aPage ); wxArrayString ret = CallRetArrayStrMethod( "GetParameterValues", arglist ); @@ -253,7 +253,7 @@ wxArrayString PYTHON_FOOTPRINT_WIZARD::GetParameterErrors( int aPage ) { PyLOCK lock; - PyObject* arglist = Py_BuildValue( "( i )", aPage ); + PyObject* arglist = Py_BuildValue( "(i)", aPage ); wxArrayString ret = CallRetArrayStrMethod( "GetParameterErrors", arglist ); Py_DECREF( arglist ); @@ -279,7 +279,7 @@ wxString PYTHON_FOOTPRINT_WIZARD::SetParameterValues( int aPage, wxArrayString& PyObject* arglist; - arglist = Py_BuildValue( "( i,O )", aPage, py_list ); + arglist = Py_BuildValue( "(i,O)", aPage, py_list ); wxString res = CallRetStrMethod( "SetParameterValues", arglist ); Py_DECREF( arglist ); diff --git a/pcbnew/tool_modedit.cpp b/pcbnew/tool_modedit.cpp index ad81dd602d..d4fe6c2351 100644 --- a/pcbnew/tool_modedit.cpp +++ b/pcbnew/tool_modedit.cpp @@ -78,7 +78,7 @@ void FOOTPRINT_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE, wxEmptyString, KiBitmap( new_footprint_xpm ), _( "New module" ) ); -#ifdef KICAD_SCRIPTING_WXPYTHON +#ifdef KICAD_SCRIPTING m_mainToolBar->AddTool( ID_MODEDIT_NEW_MODULE_FROM_WIZARD, wxEmptyString, KiBitmap( module_wizard_xpm ), _( "New module from footprint wizard" ) ); diff --git a/scripting/python_scripting.h b/scripting/python_scripting.h index 7307965159..2b646de4ab 100644 --- a/scripting/python_scripting.h +++ b/scripting/python_scripting.h @@ -44,14 +44,13 @@ public: #else - class PyLOCK { + PyGILState_STATE gil_state; + public: - // @todo: this is wrong, python docs clearly say we need the GIL, - // irrespective of wxPython. - PyLOCK() {} - ~PyLOCK() {} + PyLOCK() { gil_state = PyGILState_Ensure(); } + ~PyLOCK() { PyGILState_Release( gil_state ); } }; #endif