diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-19 19:37:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-19 19:37:40 +0200 |
commit | 80ec8364f15857c405ef0ecb1e758c8fc6b332f7 (patch) | |
tree | bf8bfdbf42d3c2aeca0f085777979f873427c642 /Python | |
parent | a5af6e1af77ee0f9294c5776478a9c24d9fbab94 (diff) | |
download | cpython-git-80ec8364f15857c405ef0ecb1e758c8fc6b332f7.tar.gz |
bpo-29748: Added the slice index converter in Argument Clinic. (#549)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index e682fc1afd..8ee58f5d30 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" |