@@ -141,7 +141,7 @@ struct type_caster<std::function<Return(Args...)>> {
141
141
142
142
std::cout << " BEFORE " << std::endl;
143
143
auto codeAttr
144
- = reinterpret_borrow<object> (PyObject_GetAttrString (src.ptr (), " __code__" ));
144
+ = reinterpret_borrow<object>(PyObject_GetAttrString (src.ptr (), " __code__" ));
145
145
assert ((static_cast <bool >(codeAttr)
146
146
== static_cast <bool >(PyObject_HasAttrString (src.ptr (), " __code__" )))
147
147
&& " ptr and "
@@ -152,16 +152,16 @@ struct type_caster<std::function<Return(Args...)>> {
152
152
argCount = argCountFromFuncCode (codeAttr);
153
153
} else {
154
154
auto callAttr
155
- = reinterpret_borrow<object> (PyObject_GetAttrString (src.ptr (), " __call__" ));
155
+ = reinterpret_borrow<object>(PyObject_GetAttrString (src.ptr (), " __call__" ));
156
156
assert ((static_cast <bool >(callAttr)
157
157
== static_cast <bool >(PyObject_HasAttrString (src.ptr (), " __call__" )))
158
158
&& " ptr and "
159
159
" HasAttrString "
160
160
" inconsistent for __call__" );
161
161
if (static_cast <bool >(PyObject_HasAttrString (src.ptr (), " __call__" ))) {
162
162
std::cout << " __call__ exists" << std::endl;
163
- auto codeAttr2 = reinterpret_borrow<object> ( PyObject_GetAttrString (
164
- callAttr.ptr (), " __code__" ));
163
+ auto codeAttr2 = reinterpret_borrow<object>(
164
+ PyObject_GetAttrString ( callAttr.ptr (), " __code__" ));
165
165
argCount = argCountFromFuncCode (codeAttr2)
166
166
- 1 ; // we have to remove the self argument
167
167
} else {
0 commit comments