summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2012-11-04 11:47:47 (GMT)
committerMark Dickinson <mdickinson@enthought.com>2012-11-04 11:47:47 (GMT)
commitc992fafddc6a2920084d2bce63d50d49f11854a0 (patch)
tree8a8e04de902d62a3ccc04b4f5ae5c079ea7e9cfd /Objects
parent729eda4a8c345bdfd7092dea155df22962cd0c9b (diff)
parent1321edaa55a8df94e739e6ea5e9e658f2b7bfcc2 (diff)
downloadcpython-c992fafddc6a2920084d2bce63d50d49f11854a0.zip
cpython-c992fafddc6a2920084d2bce63d50d49f11854a0.tar.gz
cpython-c992fafddc6a2920084d2bce63d50d49f11854a0.tar.bz2
Issue #16402: Merge fix from 3.3
Diffstat (limited to 'Objects')
-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;
}