diff options
author | Guido van Rossum <guido@python.org> | 1995-02-26 10:20:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-02-26 10:20:53 (GMT) |
commit | e7134aa0f205fcb42a6f0b7c61446e87007c4a57 (patch) | |
tree | a6aed46ef68887266a0832cfff78f5ab31c78474 /Mac/Modules | |
parent | 83c434b145793a1ec2c31f6b2f82834457753373 (diff) | |
download | cpython-e7134aa0f205fcb42a6f0b7c61446e87007c4a57.zip cpython-e7134aa0f205fcb42a6f0b7c61446e87007c4a57.tar.gz cpython-e7134aa0f205fcb42a6f0b7c61446e87007c4a57.tar.bz2 |
return old value of PyMac_DoYieldEnabled; -1 means do not even check for interrupts
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/macosmodule.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c index 177ddcd..c5f14d6 100644 --- a/Mac/Modules/macosmodule.c +++ b/Mac/Modules/macosmodule.c @@ -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"); } + |