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):
549
549
code_sink .writeln (r'''
550
550
int %(CONTAINER_CONVERTER_FUNC_NAME)s(PyObject *arg, %(CTYPE)s *container)
551
551
{
552
+ #ifndef Py_LIMITED_API
552
553
if (PyObject_IsInstance(arg, (PyObject*) &%(PYTYPESTRUCT)s)) {
553
554
*container = *((%(PYSTRUCT)s*)arg)->obj;
554
- } else if (PyList_Check(arg)) {
555
+ } else
556
+ #endif
557
+ if (PyList_Check(arg)) {
555
558
container->clear();
556
559
Py_ssize_t size = PyList_Size(arg);
557
560
for (Py_ssize_t i = 0; i < size; i++) {
@@ -581,9 +584,12 @@ def _generate_container_constructor(self, code_sink):
581
584
code_sink .writeln (r'''
582
585
int %(CONTAINER_CONVERTER_FUNC_NAME)s(PyObject *arg, %(CTYPE)s *container)
583
586
{
587
+ #ifndef Py_LIMITED_API
584
588
if (PyObject_IsInstance(arg, (PyObject*) &%(PYTYPESTRUCT)s)) {
585
589
*container = *((%(PYSTRUCT)s*)arg)->obj;
586
- } else if (PyList_Check(arg)) {
590
+ } else
591
+ #endif
592
+ if (PyList_Check(arg)) {
587
593
container->clear();
588
594
Py_ssize_t size = PyList_Size(arg);
589
595
for (Py_ssize_t i = 0; i < size; i++) {
You can’t perform that action at this time.
0 commit comments