summaryrefslogtreecommitdiffstats
path: root/Objects/rangeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/rangeobject.c')
-rw-r--r--Objects/rangeobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/rangeobject.c b/Objects/rangeobject.c
index 68d5636..214b455 100644
--- a/Objects/rangeobject.c
+++ b/Objects/rangeobject.c
@@ -331,11 +331,11 @@ compute_slice_element(PyObject *obj)
if (PyIndex_Check(obj)) {
result = PyNumber_Index(obj);
}
- }
- if (result == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "slice indices must be integers or "
- "None or have an __index__ method");
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "slice indices must be integers or "
+ "None or have an __index__ method");
+ }
}
return result;
}