Skip to content

bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API #32052

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

Merged
merged 1 commit into from
Apr 1, 2022
Merged

bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API #32052

merged 1 commit into from
Apr 1, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 22, 2022

Move the private undocumented _PyEval_EvalFrameDefault() function to
the internal C API. The function now uses the _PyInterpreterFrame
type which is part of the internal C API.

https://bugs.python.org/issue46850

@vstinner
Copy link
Member Author

According to a code search on top 5000 PyPI projects (2022-01-26), this PR only impact two projects (debuggers).

debugpy-1.5.1.zip:

src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd: #define CALL_EvalFrameDefault_39(a, b, c)    _PyEval_EvalFrameDefault(a, b, c)
src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd: #define CALL_EvalFrameDefault_38(a, b)    _PyEval_EvalFrameDefault(a, b)
src/debugpy/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.template.pyx: state.interp.eval_frame = _PyEval_EvalFrameDefault

ptvsd-4.3.2.zip: It seems like it doesn't support Python 3.9 which added the tstate parameter to _PyEval_EvalFrameDefault().

src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pxd: PyObject* _PyEval_EvalFrameDefault(PyFrameObject *frame, int exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: return _PyEval_EvalFrameDefault(frame_obj, exc)
src/ptvsd/_vendored/pydevd/_pydevd_frame_eval/pydevd_frame_evaluator.pyx: state.interp.eval_frame = _PyEval_EvalFrameDefault

@vstinner
Copy link
Member Author

See also the PR #32054 "Remove _PyInterpreterState_SetEvalFrameFunc()".

@vstinner vstinner closed this Mar 22, 2022
@vstinner vstinner reopened this Mar 22, 2022
@jansel
Copy link

jansel commented Mar 28, 2022

This (and PEP-523) is used in TorchDynamo:
https://github.com/facebookresearch/torchdynamo

We (the PyTorch team) are planning to include TorchDynamo as part of PyTorch 2.0.

Move the private undocumented _PyEval_EvalFrameDefault() function to
the internal C API. The function now uses the _PyInterpreterFrame
type which is part of the internal C API.
@vstinner vstinner changed the title bpo-46850: Remove _PyEval_EvalFrameDefault() function bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API Apr 1, 2022
@vstinner vstinner merged commit b9a5522 into python:main Apr 1, 2022
@vstinner vstinner deleted the eval_frame_default branch April 1, 2022 08:18
vstinner added a commit that referenced this pull request Apr 6, 2022
…H-32052)" (GH-32343)

* Revert "bpo-46850: Move _PyInterpreterState_SetEvalFrameFunc() to internal C API (GH-32054)"

This reverts commit f877b40.

* Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API (GH-32052)"

This reverts commit b9a5522.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants