bpo-29748: Added the slice index converter in Argument Clinic. (#549)

This commit is contained in:
Serhiy Storchaka 2017-03-19 19:37:40 +02:00 committed by GitHub
parent a5af6e1af7
commit 80ec8364f1
5 changed files with 25 additions and 3 deletions

View file

@ -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"