Skip to content

Commit dbaa10e

Browse files
Check NormalizationTest.txt into CI
1 parent 81ae8e2 commit dbaa10e

File tree

3 files changed

+19136
-7
lines changed

3 files changed

+19136
-7
lines changed

scripts/unicode.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ class OffsetType(enum.IntEnum):
7272
BitPos = int
7373

7474

75-
def fetch_open(filename: str):
75+
def fetch_open(filename: str, local_prefix: str = ""):
7676
"""Opens `filename` and return its corresponding file object. If `filename` isn't on disk,
7777
fetches it from `https://www.unicode.org/Public/`. Exits with code 1 on failure.
7878
"""
7979
basename = os.path.basename(filename)
80-
if not os.path.exists(basename):
80+
localname = os.path.join(local_prefix, basename)
81+
if not os.path.exists(localname):
8182
urllib.request.urlretrieve(
82-
f"https://www.unicode.org/Public/{UNICODE_VERSION}/ucd/{filename}", basename
83+
f"https://www.unicode.org/Public/{UNICODE_VERSION}/ucd/{filename}",
84+
localname,
8385
)
8486
try:
8587
return open(basename, encoding="utf-8")
@@ -684,7 +686,7 @@ def main(module_filename: str):
684686
variation_table = make_variation_sequence_table(emoji_variations, width_map)
685687

686688
# Download normalization test file for use by tests
687-
fetch_open("NormalizationTest.txt")
689+
fetch_open("NormalizationTest.txt", "../tests/")
688690

689691
print("------------------------")
690692
total_size = 0

0 commit comments

Comments
 (0)