31
31
download_entry ,
32
32
get_targets ,
33
33
get_target_settings ,
34
+ get_target_support_file ,
34
35
target_needs ,
35
36
validate_python_json ,
36
37
write_package_versions ,
@@ -682,7 +683,7 @@ def process_setup_line(line, variant=None):
682
683
)
683
684
684
685
with get_target_support_file (
685
- "required-extensions" , version , platform , target_triple
686
+ SUPPORT , "required-extensions" , version , platform , target_triple
686
687
).open ("r" ) as fh :
687
688
required_extensions = {l .strip () for l in fh if l .strip ()}
688
689
@@ -699,25 +700,6 @@ def process_setup_line(line, variant=None):
699
700
return bi
700
701
701
702
702
- def get_target_support_file (prefix , python_version , host_platform , target_triple ):
703
- candidates = [
704
- SUPPORT / ("%s.%s.%s" % (prefix , python_version , target_triple )),
705
- SUPPORT / ("%s.%s.%s" % (prefix , python_version , host_platform )),
706
- ]
707
-
708
- for path in candidates :
709
- if path .exists ():
710
- return path
711
-
712
- raise Exception (
713
- "Could not find support file %s for (%s, %s, %s)" ,
714
- prefix ,
715
- python_version ,
716
- host_platform ,
717
- target_triple ,
718
- )
719
-
720
-
721
703
def build_cpython (
722
704
settings ,
723
705
client ,
@@ -738,12 +720,12 @@ def build_cpython(
738
720
pip_archive = download_entry ("pip" , DOWNLOADS_PATH )
739
721
740
722
with get_target_support_file (
741
- "static-modules" , version , host_platform , target_triple
723
+ SUPPORT , "static-modules" , version , host_platform , target_triple
742
724
).open ("rb" ) as fh :
743
725
static_modules_lines = [l .rstrip () for l in fh if not l .startswith (b"#" )]
744
726
745
727
with get_target_support_file (
746
- "disabled-static-modules" , version , host_platform , target_triple
728
+ SUPPORT , "disabled-static-modules" , version , host_platform , target_triple
747
729
).open ("rb" ) as fh :
748
730
disabled_static_modules = {
749
731
l .strip () for l in fh if l .strip () and not l .strip ().startswith (b"#" )
0 commit comments