Skip to content

Commit a94b5b3

Browse files
authored
fix logic to use intermediate branch
1 parent 34388bc commit a94b5b3

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

platform.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,16 @@ def install_tool(TOOL, retry_count=0):
120120
if "arduino" in frameworks:
121121
self.packages["framework-arduinoespressif32"]["optional"] = False
122122
self.packages["framework-arduinoespressif32-libs"]["optional"] = False
123-
try:
124-
# use newer branch idf-release/v5.4 when existing
125-
self.packages["framework-arduinoespressif32"]["version"] = "https://github.com/espressif/arduino-esp32/archive/refs/heads/idf-release/v5.4.zip"
126-
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/idf-release/v5.4/package/package_esp32_index.template.json"
127-
except:
123+
# use newer branch idf-release/v5.4 when existing
124+
self.packages["framework-arduinoespressif32"]["version"] = "https://github.com/espressif/arduino-esp32/archive/refs/heads/idf-release/v5.4.zip"
125+
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/idf-release/v5.4/package/package_esp32_index.template.json"
126+
req = requests.get(URL)
127+
if req.status_code == 200:
128+
packjdata = req.json()
129+
else:
128130
# use branch master
129131
URL = "https://raw.githubusercontent.com/espressif/arduino-esp32/master/package/package_esp32_index.template.json"
130-
packjdata = requests.get(URL).json()
132+
packjdata = requests.get(URL).json()
131133
dyn_lib_url = packjdata['packages'][0]['tools'][0]['systems'][0]['url']
132134
self.packages["framework-arduinoespressif32-libs"]["version"] = dyn_lib_url
133135

0 commit comments

Comments
 (0)