Skip to content

Commit 9ad5298

Browse files
jcpunkstefanseefeld
authored andcommitted
Use python macros to stay on public API for new pythons
1 parent 944fa07 commit 9ad5298

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace detail
2525

2626
if (
2727
PyMethod_Check(m.get())
28-
&& ((PyMethodObject*)m.get())->im_self == this->m_self
28+
&& PyMethod_GET_SELF(m.get()) == this->m_self
2929
&& class_object->tp_dict != 0
3030
)
3131
{
@@ -34,7 +34,7 @@ namespace detail
3434

3535

3636
}
37-
if (borrowed_f != ((PyMethodObject*)m.get())->im_func)
37+
if (borrowed_f != PyMethod_GET_FUNCTION(m.get()))
3838
return override(m);
3939
}
4040
}

0 commit comments

Comments
 (0)