diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2022-03-31 01:24:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 01:24:02 (GMT) |
commit | db4dada5108dd49ebca23e4559a53630a2df8447 (patch) | |
tree | 77985d02dd51165ccc9cf64f5a3448b66a88aa40 /Tools/scripts/generate_global_objects.py | |
parent | f3d5715492195fd2532fc1a5d73be07923cdf2e1 (diff) | |
download | cpython-db4dada5108dd49ebca23e4559a53630a2df8447.zip cpython-db4dada5108dd49ebca23e4559a53630a2df8447.tar.gz cpython-db4dada5108dd49ebca23e4559a53630a2df8447.tar.bz2 |
bpo-47146: Avoid Using make Recursively (gh-32206)
https://bugs.python.org/issue47146
Diffstat (limited to 'Tools/scripts/generate_global_objects.py')
-rw-r--r-- | Tools/scripts/generate_global_objects.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Tools/scripts/generate_global_objects.py b/Tools/scripts/generate_global_objects.py index f765360..826f4c4 100644 --- a/Tools/scripts/generate_global_objects.py +++ b/Tools/scripts/generate_global_objects.py @@ -115,7 +115,12 @@ def iter_global_strings(): id_regex = re.compile(r'\b_Py_ID\((\w+)\)') str_regex = re.compile(r'\b_Py_DECLARE_STR\((\w+), "(.*?)"\)') for filename in iter_files(): - with open(filename, encoding='utf-8') as infile: + try: + infile = open(filename, encoding='utf-8') + except FileNotFoundError: + # The file must have been a temporary file. + continue + with infile: for lno, line in enumerate(infile, 1): for m in id_regex.finditer(line): identifier, = m.groups() |