summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 4ef10d0eb7..4362615cb0 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -90,6 +90,10 @@ frame_setlineno(PyFrameObject *f, PyObject* p_new_lineno, void *Py_UNUSED(ignore
int blockstack_top = 0; /* (ditto) */
unsigned char setup_op = 0; /* (ditto) */
+ if (p_new_lineno == NULL) {
+ PyErr_SetString(PyExc_AttributeError, "cannot delete attribute");
+ return -1;
+ }
/* f_lineno must be an integer. */
if (!PyLong_CheckExact(p_new_lineno)) {
PyErr_SetString(PyExc_ValueError,