summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-03-19 17:37:40 (GMT)
committerGitHub <noreply@github.com>2017-03-19 17:37:40 (GMT)
commit80ec8364f15857c405ef0ecb1e758c8fc6b332f7 (patch)
treebf8bfdbf42d3c2aeca0f085777979f873427c642 /Python
parenta5af6e1af77ee0f9294c5776478a9c24d9fbab94 (diff)
downloadcpython-80ec8364f15857c405ef0ecb1e758c8fc6b332f7.zip
cpython-80ec8364f15857c405ef0ecb1e758c8fc6b332f7.tar.gz
cpython-80ec8364f15857c405ef0ecb1e758c8fc6b332f7.tar.bz2
bpo-29748: Added the slice index converter in Argument Clinic. (#549)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index e682fc1..8ee58f5 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4917,6 +4917,13 @@ _PyEval_SliceIndex(PyObject *v, Py_ssize_t *pi)
return 1;
}
+int
+_PyEval_SliceIndexOrNone(PyObject *v, Py_ssize_t *pi)
+{
+ return v == Py_None || _PyEval_SliceIndex(v, pi);
+}
+
+
#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\
"BaseException is not allowed"