mirror of
https://github.com/python/cpython.git
synced 2026-02-01 12:12:05 +00:00
Fix ctypes.set_errno for gcc.
This commit is contained in:
parent
e70c3378c0
commit
8f22b88e28
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue