[Python-checkins] r63943 - python/trunk/Modules/_ctypes/callproc.c

thomas.heller python-checkins at python.org
Wed Jun 4 21:19:00 CEST 2008


Author: thomas.heller
Date: Wed Jun  4 21:19:00 2008
New Revision: 63943

Log:
Fix ctypes.set_errno for gcc.

Modified:
   python/trunk/Modules/_ctypes/callproc.c

Modified: python/trunk/Modules/_ctypes/callproc.c
==============================================================================
--- python/trunk/Modules/_ctypes/callproc.c	(original)
+++ python/trunk/Modules/_ctypes/callproc.c	Wed Jun  4 21:19:00 2008
@@ -197,10 +197,12 @@
 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
 


More information about the Python-checkins mailing list