mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
return old value of PyMac_DoYieldEnabled; -1 means do not even check for interrupts
This commit is contained in:
parent
83c434b145
commit
e7134aa0f2
2 changed files with 15 additions and 6 deletions
|
|
@ -197,13 +197,13 @@ MacOS_SetScheduleTimes(PyObject *self, PyObject *args)
|
|||
static PyObject *
|
||||
MacOS_EnableAppswitch(PyObject *self, PyObject *args)
|
||||
{
|
||||
int enable;
|
||||
int old, new;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i", &enable))
|
||||
if (!PyArg_ParseTuple(args, "i", &new))
|
||||
return NULL;
|
||||
PyMac_DoYieldEnabled = enable;
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
old = PyMac_DoYieldEnabled;
|
||||
PyMac_DoYieldEnabled = new;
|
||||
return Py_BuildValue("i", old);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -246,3 +246,4 @@ MacOS_Init()
|
|||
if (MacOS_Error == NULL || PyDict_SetItemString(d, "Error", MacOS_Error) != 0)
|
||||
Py_FatalError("can't define MacOS.Error");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue