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

gh-99016: Make build scripts compatible with Python 3.8 #99017

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1 @@
Fix build with ``PYTHON_FOR_REGEN=python3.8``.
4 changes: 2 additions & 2 deletions Tools/build/generate_levenshtein_examples.py
@@ -1,7 +1,7 @@
"""Generate 10,000 unique examples for the Levenshtein short-circuit tests."""

import argparse
from functools import cache
from functools import lru_cache
import json
import os.path
from random import choices, randrange
Expand All @@ -22,7 +22,7 @@ def _substitution_cost(ch_a, ch_b):
return _MOVE_COST


@cache
@lru_cache(None)
def levenshtein(a, b):
if not a or not b:
return (len(a) + len(b)) * _MOVE_COST
Expand Down
2 changes: 1 addition & 1 deletion Tools/build/generate_opcode_h.py
Expand Up @@ -108,7 +108,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)

Expand Down