no exception when metrics not found (#22170)

This commit is contained in:
Jason2866 2024-09-19 18:31:47 +02:00 committed by GitHub
parent 3b28542d9c
commit 5d0cc8144a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 2 deletions

View File

@ -6,8 +6,11 @@ from os.path import join
def firm_metrics(source, target, env): def firm_metrics(source, target, env):
if env["PIOPLATFORM"] == "espressif32": if env["PIOPLATFORM"] == "espressif32":
try:
import tasmota_metrics import tasmota_metrics
env.Execute("$PYTHONEXE -m tasmota_metrics \"" + str(tasmotapiolib.get_source_map_path(env).resolve()) + "\"") env.Execute("$PYTHONEXE -m tasmota_metrics \"" + str(tasmotapiolib.get_source_map_path(env).resolve()) + "\"")
except:
pass
elif env["PIOPLATFORM"] == "espressif8266": elif env["PIOPLATFORM"] == "espressif8266":
map_file = join(env.subst("$BUILD_DIR")) + os.sep + "firmware.map" map_file = join(env.subst("$BUILD_DIR")) + os.sep + "firmware.map"
with open(map_file,'r', encoding='utf-8') as f: with open(map_file,'r', encoding='utf-8') as f: