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

Support frame eval mode in Python 3.9 #441

Closed
fabioz opened this issue Oct 22, 2020 · 3 comments
Closed

Support frame eval mode in Python 3.9 #441

fabioz opened this issue Oct 22, 2020 · 3 comments

Comments

@fabioz
Copy link
Collaborator

fabioz commented Oct 22, 2020

It seems that:

PyInterpreterState.eval_frame (PEP 523) now requires a new mandatory tstate parameter (PyThreadState*). (Contributed by Victor Stinner in :issue:38500.)

@fabioz
Copy link
Collaborator Author

fabioz commented Oct 30, 2020

As a note, I'm working on this now.

@fabioz
Copy link
Collaborator Author

fabioz commented Nov 5, 2020

@karthiknadig @int19h

I still haven't finished this... the actual fix is simple (mostly dealing with the new frame object required in _PyEval_EvalFrameDefault), but I couldn't figure out a way to do the the processing without regenerating the .c files (i.e.: having a single .c file valid for both Python 3.8 and Python 3.9).

i.e.: If the pre-processing is done on the cython level the related .c files aren't valid for all versions and I couldn't find a way to do the needed #if pre-processing on the C-level from cython.

Given that, I'm thinking about no longer commiting the .c files to the repository and always regenerating them from the .pyx files. I think that the main change is that cython will need to be available for doing the compilation (whereas right now only a C/C++ compiler is needed).

Do you think this is a problem?

-- another option could be pre-creating one .c for Python 3.8 and another for Python 3.9 (the issues here is that the related cython file which has around 600 lines becomes 20k lines of C and some more logic will be needed due to those name changes).

fabioz added a commit to fabioz/debugpy that referenced this issue Nov 6, 2020
fabioz added a commit to fabioz/debugpy that referenced this issue Nov 6, 2020
@fabioz
Copy link
Collaborator Author

fabioz commented Nov 6, 2020

Actually, by using some code generation and macros I've been able to make it compile with a single .c for Python 3.8 and Python 3.9 -- cython makes it a bit tricky but I think it's still reasonable (so, it should keep on working as it already does).

@fabioz fabioz closed this as completed in c6dc935 Nov 7, 2020
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

No branches or pull requests

1 participant