projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e70c337
)
Fix ctypes.set_errno for gcc.
author
Thomas Heller
<theller@ctypes.org>
Wed, 4 Jun 2008 19:19:00 +0000
(19:19 +0000)
committer
Thomas Heller
<theller@ctypes.org>
Wed, 4 Jun 2008 19:19:00 +0000
(19:19 +0000)
Modules/_ctypes/callproc.c
patch
|
blob
|
history
diff --git
a/Modules/_ctypes/callproc.c
b/Modules/_ctypes/callproc.c
index 70ca73f10a03e3d2b485754702364587376d63b0..aa297af7b3e3e7b8f28b2aa2a8b971a112092ddc 100644
(file)
--- a/
Modules/_ctypes/callproc.c
+++ b/
Modules/_ctypes/callproc.c
@@
-197,10
+197,12
@@
get_errno(PyObject *self, PyObject *args)
static PyObject *
set_errno(PyObject *self, PyObject *args)
{
- int new_errno;
+ int new_errno
, prev_errno
;
if (!PyArg_ParseTuple(args, "i", &new_errno))
return NULL;
- return PyInt_FromLong(_save_errno(new_errno));
+ prev_errno = ctypes_errno;
+ ctypes_errno = new_errno;
+ return PyInt_FromLong(prev_errno);
}
#else