File tree Expand file tree Collapse file tree 3 files changed +19136
-7
lines changed Expand file tree Collapse file tree 3 files changed +19136
-7
lines changed Original file line number Diff line number Diff line change @@ -72,14 +72,16 @@ class OffsetType(enum.IntEnum):
7272BitPos = 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
You can’t perform that action at this time.
0 commit comments