commit | acc8cf2cfa18c445e8c9b324206eb7c5e392bcb7 | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Fri Jul 04 20:24:13 2014 -0400 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Fri Jul 04 20:24:13 2014 -0400 |
tree | 0c8300eb1c66c97fcf29404ef008b3d544aeefdb | |
parent | e865128605faf64c63cd216507a0875e4c5a424b [diff] [blame] |
Issue #21897: Fix a crash with the f_locals attribute with closure variables when frame.clear() has been called.
diff --git a/Objects/frameobject.c b/Objects/frameobject.c index 0d62293..55ee563 100644 --- a/Objects/frameobject.c +++ b/Objects/frameobject.c
@@ -786,7 +786,7 @@ PyObject *key = PyTuple_GET_ITEM(map, j); PyObject *value = values[j]; assert(PyUnicode_Check(key)); - if (deref) { + if (deref && value != NULL) { assert(PyCell_Check(value)); value = PyCell_GET(value); }