otatool: let fail early on exception

otatool gives a 'target has no otadata' error instead of the real cause
(because of wrong port specified, for example)
This commit is contained in:
Renz Bagaporo
2020-12-14 17:11:41 +08:00
parent a926039575
commit 84d3b0f81d

View File

@@ -63,8 +63,6 @@ class OtatoolTarget():
self.target.read_partition(OtatoolTarget.OTADATA_PARTITION, temp_file.name)
with open(temp_file.name, "rb") as f:
self.otadata = f.read()
except Exception:
self.otadata = None
finally:
os.unlink(temp_file.name)