Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix _PyObject_FastCall for Python 3.13 #17502

Merged
merged 1 commit into from
Jul 7, 2024

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Jul 7, 2024

_PyObject_FastCall will be removed in 3.13. It can safely replaced by PyObject_Vectorcall (available since 3.9) / _PyObject_Vectorcall (available since 3.8). python/cpython#106023 (comment)

https://peps.python.org/pep-0590/

Fixes

  /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h: In function ‘update_bases’: (diff)
  /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h:62:20: error: implicit declaration of function ‘_PyObject_FastCall’; did you mean ‘PyObject_Call’? [-Werror=implicit-function-declaration] (diff)
     62 |         new_base = _PyObject_FastCall(meth, stack, 1); (diff)
  /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h:62:18: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] (diff)
     62 |         new_base = _PyObject_FastCall(meth, stack, 1); (diff)
        |                  ^ (diff)
  /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h: In function ‘init_subclass’: (diff)
  /home/runner/work/mypy/mypy/mypyc/lib-rt/pythonsupport.h:111:11: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Werror=int-conversion] (diff)
    111 |     super = _PyObject_FastCall((PyObject *)&PySuper_Type, args, 2); (diff)
        |           ^ (diff)

@cdce8p cdce8p added the topic-mypyc mypyc bugs label Jul 7, 2024
@hauntsaninja hauntsaninja merged commit 4c54801 into python:master Jul 7, 2024
14 checks passed
@cdce8p cdce8p deleted the fix-3.13-fast-call branch July 7, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-mypyc mypyc bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants