diff options
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/object.c b/Objects/object.c index 8018c6a58c..95a5334d8b 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1407,12 +1407,11 @@ static PyObject * _dir_locals(void) { PyObject *names; - PyObject *locals = PyEval_GetLocals(); + PyObject *locals; - if (locals == NULL) { - PyErr_SetString(PyExc_SystemError, "frame does not exist"); + locals = PyEval_GetLocals(); + if (locals == NULL) return NULL; - } names = PyMapping_Keys(locals); if (!names) |