Kaydet (Commit) 691270fe authored tarafından Marc-André Lemburg's avatar Marc-André Lemburg

Deferred the attribute name object type checking to the underlying

PyObject_Set/GetAttr() calls.

This patch fixes bug #113829.
üst 1675375a
...@@ -824,7 +824,7 @@ builtin_getattr(PyObject *self, PyObject *args) ...@@ -824,7 +824,7 @@ builtin_getattr(PyObject *self, PyObject *args)
PyObject *v, *result, *dflt = NULL; PyObject *v, *result, *dflt = NULL;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, "OS|O:getattr", &v, &name, &dflt)) if (!PyArg_ParseTuple(args, "OO|O:getattr", &v, &name, &dflt))
return NULL; return NULL;
result = PyObject_GetAttr(v, name); result = PyObject_GetAttr(v, name);
if (result == NULL && dflt != NULL) { if (result == NULL && dflt != NULL) {
...@@ -867,7 +867,7 @@ builtin_hasattr(PyObject *self, PyObject *args) ...@@ -867,7 +867,7 @@ builtin_hasattr(PyObject *self, PyObject *args)
PyObject *v; PyObject *v;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, "OS:hasattr", &v, &name)) if (!PyArg_ParseTuple(args, "OO:hasattr", &v, &name))
return NULL; return NULL;
v = PyObject_GetAttr(v, name); v = PyObject_GetAttr(v, name);
if (v == NULL) { if (v == NULL) {
...@@ -1076,7 +1076,7 @@ builtin_setattr(PyObject *self, PyObject *args) ...@@ -1076,7 +1076,7 @@ builtin_setattr(PyObject *self, PyObject *args)
PyObject *name; PyObject *name;
PyObject *value; PyObject *value;
if (!PyArg_ParseTuple(args, "OSO:setattr", &v, &name, &value)) if (!PyArg_ParseTuple(args, "OOO:setattr", &v, &name, &value))
return NULL; return NULL;
if (PyObject_SetAttr(v, name, value) != 0) if (PyObject_SetAttr(v, name, value) != 0)
return NULL; return NULL;
...@@ -1097,7 +1097,7 @@ builtin_delattr(PyObject *self, PyObject *args) ...@@ -1097,7 +1097,7 @@ builtin_delattr(PyObject *self, PyObject *args)
PyObject *v; PyObject *v;
PyObject *name; PyObject *name;
if (!PyArg_ParseTuple(args, "OS:delattr", &v, &name)) if (!PyArg_ParseTuple(args, "OO:delattr", &v, &name))
return NULL; return NULL;
if (PyObject_SetAttr(v, name, (PyObject *)NULL) != 0) if (PyObject_SetAttr(v, name, (PyObject *)NULL) != 0)
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment