diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/_ctypes.c | 2 | ||||
-rw-r--r-- | Modules/_ctypes/stgdict.c | 2 | ||||
-rw-r--r-- | Modules/socketmodule.c | 11 |
3 files changed, 9 insertions, 6 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index c5e3be4..f60d494 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -401,7 +401,7 @@ static int StructType_setattro(PyObject *self, PyObject *key, PyObject *value) { /* XXX Should we disallow deleting _fields_? */ - if (-1 == PyObject_GenericSetAttr(self, key, value)) + if (-1 == PyType_Type.tp_setattro(self, key, value)) return -1; if (value && PyUnicode_Check(key) && diff --git a/Modules/_ctypes/stgdict.c b/Modules/_ctypes/stgdict.c index 11a1a63..9914cab 100644 --- a/Modules/_ctypes/stgdict.c +++ b/Modules/_ctypes/stgdict.c @@ -458,7 +458,7 @@ StructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct) Py_DECREF(pair); return -1; } - if (-1 == PyDict_SetItem(realdict, name, prop)) { + if (-1 == PyObject_SetAttr(type, name, prop)) { Py_DECREF(prop); Py_DECREF(pair); return -1; diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 7ad96d3..37e7caa 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4979,10 +4979,13 @@ init_socket(void) #endif #ifdef SIO_RCVALL - tmp = PyLong_FromUnsignedLong(SIO_RCVALL); - if (tmp == NULL) - return; - PyModule_AddObject(m, "SIO_RCVALL", tmp); + { + PyObject *tmp; + tmp = PyLong_FromUnsignedLong(SIO_RCVALL); + if (tmp == NULL) + return; + PyModule_AddObject(m, "SIO_RCVALL", tmp); + } PyModule_AddIntConstant(m, "RCVALL_OFF", RCVALL_OFF); PyModule_AddIntConstant(m, "RCVALL_ON", RCVALL_ON); PyModule_AddIntConstant(m, "RCVALL_SOCKETLEVELONLY", RCVALL_SOCKETLEVELONLY); |