Skip to content

Commit

Permalink
gh-99016: Make build scripts compatible with Python 3.8 (GH-99017)
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 2, 2022
1 parent 276d777 commit f520d72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
@@ -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

0 comments on commit f520d72

Please sign in to comment.