Use the PyGILState_* APIs on Python >= 2.3

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32701 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-03-09 22:28:52 +00:00
parent 168f82ce0a
commit 6e6b35578d
37 changed files with 318 additions and 281 deletions

View File

@@ -64,7 +64,7 @@ static wxString _VARTYPEname(VARTYPE vt);
inline bool wxPyErr_Occurred()
{
bool rval;
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
rval = PyErr_Occurred() != NULL;
wxPyEndBlockThreads(blocked);
return rval;
@@ -329,7 +329,7 @@ public:
void SetAXProp(const wxString& name, PyObject* value)
{
const wxPropX& prop = GetAXPropDesc(name);
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (! PyErr_Occurred() ) {
if (! prop.CanSet()) {
wxString msg;
@@ -365,7 +365,7 @@ public:
{
PyObject* rval = NULL;
const wxPropX& prop = GetAXPropDesc(name);
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (! PyErr_Occurred() ) {
if (! prop.CanGet()) {
wxString msg;
@@ -411,7 +411,7 @@ public:
PyObject* rval = NULL;
const wxFuncX& func = GetAXMethodDesc(name);
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
if (! PyErr_Occurred() ) {
nargs = func.params.size();
if (nargs > 0)
@@ -641,7 +641,7 @@ public:
// handler. We'll convert and load the ActiveX event parameters into
// attributes of the Python event object.
void _preCallInit(PyObject* pyself) {
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
PyObject* pList = PyList_New(0);
PyObject_SetAttrString(pyself, "paramList", pList);
Py_DECREF(pList);
@@ -660,7 +660,7 @@ public:
// handler. It reloads any "out" parameters from the python attributes
// back into the wxVariant they came from.
void _postCallCleanup(PyObject* pyself) {
bool blocked = wxPyBeginBlockThreads();
wxPyBlock_t blocked = wxPyBeginBlockThreads();
for (int i=0; i<self->ParamCount(); i+=1) {
PyObject* val = PyObject_GetAttrString(
pyself, (char*)(const char*)self->ParamName(i).mb_str());