File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -549,9 +549,12 @@ def _generate_container_constructor(self, code_sink):
549549 code_sink .writeln (r'''
550550int %(CONTAINER_CONVERTER_FUNC_NAME)s(PyObject *arg, %(CTYPE)s *container)
551551{
552+ #ifndef Py_LIMITED_API
552553 if (PyObject_IsInstance(arg, (PyObject*) &%(PYTYPESTRUCT)s)) {
553554 *container = *((%(PYSTRUCT)s*)arg)->obj;
554- } else if (PyList_Check(arg)) {
555+ } else
556+ #endif
557+ if (PyList_Check(arg)) {
555558 container->clear();
556559 Py_ssize_t size = PyList_Size(arg);
557560 for (Py_ssize_t i = 0; i < size; i++) {
@@ -581,9 +584,12 @@ def _generate_container_constructor(self, code_sink):
581584 code_sink .writeln (r'''
582585int %(CONTAINER_CONVERTER_FUNC_NAME)s(PyObject *arg, %(CTYPE)s *container)
583586{
587+ #ifndef Py_LIMITED_API
584588 if (PyObject_IsInstance(arg, (PyObject*) &%(PYTYPESTRUCT)s)) {
585589 *container = *((%(PYSTRUCT)s*)arg)->obj;
586- } else if (PyList_Check(arg)) {
590+ } else
591+ #endif
592+ if (PyList_Check(arg)) {
587593 container->clear();
588594 Py_ssize_t size = PyList_Size(arg);
589595 for (Py_ssize_t i = 0; i < size; i++) {
You can’t perform that action at this time.
0 commit comments