Skip to content

Commit 0761872

Browse files
committed
Copy over only PO files to avoid warnings on extra files
1 parent 84e0a79 commit 0761872

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build_warnings.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@
55

66

77
def number(clones_dir: str, repo: str, language_code: str) -> int:
8-
Path(clones_dir, f'cpython/Doc/locales/{language_code}').mkdir(parents=True)
9-
Path(clones_dir, f'cpython/Doc/locales/{language_code}/LC_MESSAGES').symlink_to(
10-
Path(clones_dir, repo), True
11-
)
8+
locale_dir = Path(clones_dir, f'cpython/Doc/locales/{language_code}/LC_MESSAGES')
9+
locale_dir.mkdir(parents=True)
10+
for po_file in Path(clones_dir, repo).rglob('*.po'):
11+
relative_path = po_file.relative_to(Path(clones_dir, repo))
12+
target_file = locale_dir / relative_path
13+
target_file.parent.mkdir(parents=True, exist_ok=True)
14+
copyfile(po_file, target_file)
1215
sphinx.cmd.build.main(
1316
(
1417
'--builder',

0 commit comments

Comments
 (0)