From 581e23a31f490a974fc88b27bfe56c710e97024f Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Wed, 2 Nov 2022 20:30:09 +0200 Subject: [PATCH] [3.11] gh-99016: Make build scripts compatible with Python 3.8 (GH-99017). (cherry picked from commit f520d720f667c87f7b70ed86ea58d73892d6b969) Co-authored-by: Serhiy Storchaka --- .../next/Build/2022-11-02-19-25-07.gh-issue-99016.R05NkD.rst | 1 + Tools/scripts/generate_opcode_h.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Build/2022-11-02-19-25-07.gh-issue-99016.R05NkD.rst diff --git a/Misc/NEWS.d/next/Build/2022-11-02-19-25-07.gh-issue-99016.R05NkD.rst b/Misc/NEWS.d/next/Build/2022-11-02-19-25-07.gh-issue-99016.R05NkD.rst new file mode 100644 index 00000000000000..df189daca3a230 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2022-11-02-19-25-07.gh-issue-99016.R05NkD.rst @@ -0,0 +1 @@ +Fix build with ``PYTHON_FOR_REGEN=python3.8``. diff --git a/Tools/scripts/generate_opcode_h.py b/Tools/scripts/generate_opcode_h.py index 6a04297879f2cb..5b225f27c4f7cf 100644 --- a/Tools/scripts/generate_opcode_h.py +++ b/Tools/scripts/generate_opcode_h.py @@ -102,7 +102,7 @@ def main(opcode_py, outfile='Include/opcode.h', internaloutfile='Include/interna opname_including_specialized[255] = 'DO_TRACING' used[255] = True - with (open(outfile, 'w') as fobj, open(internaloutfile, 'w') as iobj): + with open(outfile, 'w') as fobj, open(internaloutfile, 'w') as iobj: fobj.write(header) iobj.write(internal_header)