diff options
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 63e5812..5053f7a 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2255,16 +2255,12 @@ builtin_vars(PyObject *self, PyObject *args) return NULL; if (v == NULL) { d = PyEval_GetLocals(); - if (d == NULL) - return NULL; - Py_INCREF(d); + Py_XINCREF(d); } else { - d = _PyObject_GetAttrId(v, &PyId___dict__); - if (d == NULL) { + if (_PyObject_LookupAttrId(v, &PyId___dict__, &d) == 0) { PyErr_SetString(PyExc_TypeError, "vars() argument must have __dict__ attribute"); - return NULL; } } return d; |