mirror of
https://github.com/python/cpython.git
synced 2025-08-19 00:00:48 +00:00
gh-101907: Stop using _Py_OPCODE
and _Py_OPARG
macros (GH-101912)
* gh-101907: Removes use of non-standard C++ extension from Include/cpython/code.h * Make cases_generator correct on Windows
This commit is contained in:
parent
c00faf7943
commit
a99eb5cd99
13 changed files with 200 additions and 184 deletions
|
@ -8,6 +8,7 @@ import argparse
|
|||
import contextlib
|
||||
import dataclasses
|
||||
import os
|
||||
import posixpath
|
||||
import re
|
||||
import sys
|
||||
import typing
|
||||
|
@ -17,7 +18,7 @@ from parser import StackEffect
|
|||
|
||||
HERE = os.path.dirname(__file__)
|
||||
ROOT = os.path.join(HERE, "../..")
|
||||
THIS = os.path.relpath(__file__, ROOT)
|
||||
THIS = os.path.relpath(__file__, ROOT).replace(os.path.sep, posixpath.sep)
|
||||
|
||||
DEFAULT_INPUT = os.path.relpath(os.path.join(ROOT, "Python/bytecodes.c"))
|
||||
DEFAULT_OUTPUT = os.path.relpath(os.path.join(ROOT, "Python/generated_cases.c.h"))
|
||||
|
@ -930,7 +931,7 @@ class Analyzer:
|
|||
with open(self.metadata_filename, "w") as f:
|
||||
# Write provenance header
|
||||
f.write(f"// This file is generated by {THIS} --metadata\n")
|
||||
f.write(f"// from {os.path.relpath(self.filename, ROOT)}\n")
|
||||
f.write(f"// from {os.path.relpath(self.filename, ROOT).replace(os.path.sep, posixpath.sep)}\n")
|
||||
f.write(f"// Do not edit!\n")
|
||||
|
||||
# Create formatter; the rest of the code uses this
|
||||
|
@ -1009,7 +1010,7 @@ class Analyzer:
|
|||
with open(self.output_filename, "w") as f:
|
||||
# Write provenance header
|
||||
f.write(f"// This file is generated by {THIS}\n")
|
||||
f.write(f"// from {os.path.relpath(self.filename, ROOT)}\n")
|
||||
f.write(f"// from {os.path.relpath(self.filename, ROOT).replace(os.path.sep, posixpath.sep)}\n")
|
||||
f.write(f"// Do not edit!\n")
|
||||
|
||||
# Create formatter; the rest of the code uses this
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue