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

bpo-35134: Remove the Include/code.h header file #32385

Merged
merged 2 commits into from Apr 7, 2022

Conversation

Copy link
Member

@vstinner vstinner commented Apr 6, 2022

Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.

https://bugs.python.org/issue35134

@vstinner
Copy link
Member Author

@vstinner vstinner commented Apr 6, 2022

None of the top 5000 PyPI projects include directly code.h:

$ ./search_pypi_top.py PYPI-2022-01-26-TOP-5000/ '# *include [<"]code.h[">]' -q
PYPI-2022-01-26-TOP-5000/Pygments-2.11.2.tar.gz: Pygments-2.11.2/tests/examplefiles/c/ceval.c: #include "code.h"
PYPI-2022-01-26-TOP-5000/typed_ast-1.5.2.tar.gz: typed_ast-1.5.2/ast27/Include/compile.h: #include "code.h"

Found 2 matching lines in 2 projects
  • Pygments only uses ceval.c has an example: this C file is not built
  • typed_ast ast27/Include/compile.h is only used on Python 2.7

vstinner added 2 commits Apr 6, 2022
Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.
@vstinner vstinner merged commit 85addfb into python:main Apr 7, 2022
12 checks passed
@vstinner vstinner deleted the remove_code_h branch Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants