@@ -847,8 +847,13 @@ CDataType_from_param(PyObject *type, PyObject *value)
847
847
return NULL ;
848
848
}
849
849
if (as_parameter ) {
850
+ if (_Py_EnterRecursiveCall (" while processing _as_parameter_" )) {
851
+ Py_DECREF (as_parameter );
852
+ return NULL ;
853
+ }
850
854
value = CDataType_from_param (type , as_parameter );
851
855
Py_DECREF (as_parameter );
856
+ _Py_LeaveRecursiveCall ();
852
857
return value ;
853
858
}
854
859
PyErr_Format (PyExc_TypeError ,
@@ -1716,8 +1721,13 @@ c_wchar_p_from_param(PyObject *type, PyObject *value)
1716
1721
return NULL ;
1717
1722
}
1718
1723
if (as_parameter ) {
1724
+ if (_Py_EnterRecursiveCall (" while processing _as_parameter_" )) {
1725
+ Py_DECREF (as_parameter );
1726
+ return NULL ;
1727
+ }
1719
1728
value = c_wchar_p_from_param (type , as_parameter );
1720
1729
Py_DECREF (as_parameter );
1730
+ _Py_LeaveRecursiveCall ();
1721
1731
return value ;
1722
1732
}
1723
1733
/* XXX better message */
@@ -1780,8 +1790,13 @@ c_char_p_from_param(PyObject *type, PyObject *value)
1780
1790
return NULL ;
1781
1791
}
1782
1792
if (as_parameter ) {
1793
+ if (_Py_EnterRecursiveCall (" while processing _as_parameter_" )) {
1794
+ Py_DECREF (as_parameter );
1795
+ return NULL ;
1796
+ }
1783
1797
value = c_char_p_from_param (type , as_parameter );
1784
1798
Py_DECREF (as_parameter );
1799
+ _Py_LeaveRecursiveCall ();
1785
1800
return value ;
1786
1801
}
1787
1802
/* XXX better message */
@@ -1915,8 +1930,13 @@ c_void_p_from_param(PyObject *type, PyObject *value)
1915
1930
return NULL ;
1916
1931
}
1917
1932
if (as_parameter ) {
1933
+ if (_Py_EnterRecursiveCall (" while processing _as_parameter_" )) {
1934
+ Py_DECREF (as_parameter );
1935
+ return NULL ;
1936
+ }
1918
1937
value = c_void_p_from_param (type , as_parameter );
1919
1938
Py_DECREF (as_parameter );
1939
+ _Py_LeaveRecursiveCall ();
1920
1940
return value ;
1921
1941
}
1922
1942
/* XXX better message */
@@ -2275,9 +2295,9 @@ PyCSimpleType_from_param(PyObject *type, PyObject *value)
2275
2295
return NULL ;
2276
2296
}
2277
2297
value = PyCSimpleType_from_param (type , as_parameter );
2278
- _Py_LeaveRecursiveCall ();
2279
2298
Py_DECREF (as_parameter );
2280
2299
Py_XDECREF (exc );
2300
+ _Py_LeaveRecursiveCall ();
2281
2301
return value ;
2282
2302
}
2283
2303
if (exc ) {
0 commit comments