summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index e074810..7ac2a1f 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -215,6 +215,8 @@ structseq_contains(PyStructSequence *obj, PyObject *o)
PyObject *tup;
int result;
tup = make_tuple(obj);
+ if (!tup)
+ return -1;
result = PySequence_Contains(tup, o);
Py_DECREF(tup);
return result;
@@ -226,6 +228,8 @@ structseq_hash(PyObject *obj)
PyObject *tup;
long result;
tup = make_tuple((PyStructSequence*) obj);
+ if (!tup)
+ return -1;
result = PyObject_Hash(tup);
Py_DECREF(tup);
return result;