classification
Title: Remove Tools/scripts/h2py.py
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: vstinner
Priority: normal Keywords: patch

Created on 2019-07-29 11:58 by vstinner, last changed 2019-07-30 15:45 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15000 merged vstinner, 2019-07-29 12:00
Messages (3)
msg348643 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-29 11:58
Python 2 standard library had platform specific modules like CDROM which were generated by Tools/scripts/h2py.py. These modules were removed, but h2py.py is still around.

There are now way better ways to expose C APIs in Python like cffi.

I propose to simply remove Tools/scripts/h2py.py.

Attached PR removes the file and update files which mention it. It would allow to simply close bpo-13032.
msg348742 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-30 14:07
Lib/plat-*/ directories has been removed in Python 3.6 by:

commit 20737cc91e823b6b17fff16574283c034c99d641
Author: Zachary Ware <zachary.ware@gmail.com>
Date:   Thu Sep 8 11:38:46 2016 -0700

    Issue #28027: Remove Lib/plat-* files

> Python 2 standard library had platform specific modules like CDROM which were generated by Tools/scripts/h2py.py. These modules were removed, but h2py.py is still around.

Example of Python 2.7:

$ head -n1 Lib/plat-linux2/IN.py 
# Generated by h2py from /usr/include/netinet/in.h
...

$ tail -n1 Lib/plat-linux2/regen 
...
h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/dlfcn.h
msg348754 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2019-07-30 15:45
New changeset 27eeaf0f2c9bd53a0fbdfdf38ee759e971221f8d by Victor Stinner in branch 'master':
bpo-37704: Remove Tools/scripts/h2py.py (GH-15000)
https://github.com/python/cpython/commit/27eeaf0f2c9bd53a0fbdfdf38ee759e971221f8d
History
Date User Action Args
2019-07-30 15:45:57vstinnersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-07-30 15:45:33vstinnersetmessages: + msg348754
2019-07-30 14:07:46vstinnersetmessages: + msg348742
2019-07-29 12:00:03vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request14766
2019-07-29 11:58:12vstinnercreate