@@ -80,35 +80,35 @@ def install_selected_python_version(installer_url, installer_folder):
8080 exit (1 )
8181
8282
83- def get_installer_url (requested_version , version_manifest ):
83+ def get_installer_url (requested_version , requested_arch , version_manifest ):
8484 current_plat = platform .system ().lower ()
8585
8686 print ("Current Platform Is {}" .format (platform .platform ()))
8787
8888 if version_manifest [requested_version ]:
8989 found_installers = version_manifest [requested_version ]["files" ]
9090
91- # filter anything that's not x64. we don't care .
92- x64_installers = [
93- file_def for file_def in found_installers if file_def ["arch" ] == "x64"
91+ # filter anything that's not our requested architecture .
92+ arch_installers = [
93+ file_def for file_def in found_installers if file_def ["arch" ] == requested_arch
9494 ]
9595
9696 if current_plat == "windows" :
9797 return [
9898 installer
99- for installer in x64_installers
99+ for installer in arch_installers
100100 if installer ["platform" ] == "win32"
101101 ][0 ]
102102 elif current_plat == "darwin" :
103103 return [
104104 installer
105- for installer in x64_installers
105+ for installer in arch_installers
106106 if installer ["platform" ] == current_plat
107107 ][0 ]
108108 else :
109109 return [
110110 installer
111- for installer in x64_installers
111+ for installer in arch_installers
112112 if installer ["platform" ] == "linux"
113113 and installer ["platform_version" ] == CURRENT_UBUNTU_VERSION
114114 ][0 ]
@@ -125,6 +125,13 @@ def get_installer_url(requested_version, version_manifest):
125125 help = ("The version specifier passed in to the UsePythonVersion extended task." ),
126126 )
127127
128+ parser .add_argument (
129+ "--arch" ,
130+ dest = "arch" ,
131+ default = "x64" ,
132+ help = ("The architecture passed in to the UsePythonVersion extended task." ),
133+ )
134+
128135 parser .add_argument (
129136 "--installer_folder" ,
130137 dest = "installer_folder" ,
@@ -152,7 +159,7 @@ def get_installer_url(requested_version, version_manifest):
152159 args .version_spec
153160 )
154161 )
155- install_file_details = get_installer_url (args .version_spec , version_dict )
162+ install_file_details = get_installer_url (args .version_spec , args . arch , version_dict )
156163 install_selected_python_version (
157164 install_file_details ["download_url" ], args .installer_folder
158- )
165+ )
0 commit comments