File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,10 @@ def emit_line() -> None:
322322 fields ['tp_vectorcall_offset' ] = 'offsetof({}, vectorcall)' .format (
323323 cl .struct_name (emitter .names ))
324324 flags .append ('_Py_TPFLAGS_HAVE_VECTORCALL' )
325+ if not fields .get ('tp_vectorcall' ):
326+ # This is just a placeholder to please CPython. It will be
327+ # overriden during setup.
328+ fields ['tp_call' ] = 'PyVectorcall_Call'
325329 fields ['tp_flags' ] = ' | ' .join (flags )
326330
327331 emitter .emit_line (f"static PyTypeObject { emitter .type_struct_name (cl )} _template_ = {{" )
Original file line number Diff line number Diff line change @@ -2206,3 +2206,13 @@ def test_serializable_sub_class_call_new() -> None:
22062206 base: NonSerializable = sub
22072207 with assertRaises(AttributeError):
22082208 base.s
2209+
2210+ [case testClassWithInherited__call__]
2211+ class Base:
2212+ def __call__(self) -> int:
2213+ return 1
2214+
2215+ class Derived(Base):
2216+ pass
2217+
2218+ assert Derived()() == 1
You can’t perform that action at this time.
0 commit comments