Skip to content

Commit 98ac326

Browse files
add notes in comments that this is copypaste
1 parent 1df49ee commit 98ac326

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Lib/test/support/constants_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from test.support.project_files_helper import iter_all_c_files
77

88

9+
# copypaste from 'Tools/build/generate_global_objects.py'
910
def iter_global_strings() -> Iterable[str]:
1011
id_regex = re.compile(r"\b_Py_ID\((\w+)\)")
1112
str_regex = re.compile(r'\b_Py_DECLARE_STR\((?:\w+), "(.*?)"\)')

Lib/test/support/project_files_helper.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from typing import Iterable
44

5-
python_root = Path(__file__).resolve().parents[3]
5+
ROOT = Path(__file__).resolve().parents[3]
66

77

8+
# copypaste from 'Tools/build/generate_global_objects.py'
89
def iter_all_c_files() -> Iterable[Path]:
910
for top_directory_name in (
1011
"Modules",
@@ -14,7 +15,7 @@ def iter_all_c_files() -> Iterable[Path]:
1415
"Programs",
1516
"Python",
1617
):
17-
for dirname, _, files in (python_root / top_directory_name).walk():
18+
for dirname, _, files in (ROOT / top_directory_name).walk():
1819
for name in files:
1920
if not name.endswith((".c", ".h")):
2021
continue

0 commit comments

Comments
 (0)