mirror of
https://github.com/python/cpython.git
synced 2025-07-18 08:45:20 +00:00
bpo-47146: Avoid Using make Recursively (gh-32206)
https://bugs.python.org/issue47146
This commit is contained in:
parent
f3d5715492
commit
db4dada510
2 changed files with 24 additions and 10 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue