diff options
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r-- | Objects/abstract.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index a94a136..cfa4cc8 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1055,6 +1055,12 @@ PySequence_List(v) { PySequenceMethods *m; + if (v == NULL) + return null_error(); + + if (PyList_Check(v)) + return PyList_GetSlice(v, 0, PyList_GET_SIZE(v)); + m = v->ob_type->tp_as_sequence; if (m && m->sq_item) { int i; |