From 80ec8364f15857c405ef0ecb1e758c8fc6b332f7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 19 Mar 2017 19:37:40 +0200 Subject: bpo-29748: Added the slice index converter in Argument Clinic. (#549) --- Python/ceval.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Python/ceval.c') 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" -- cgit v1.2.1