3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-10-04 00:33:58 +00:00

Don't use python asserts to handle unexpected solver output

This commit is contained in:
Jannis Harder 2022-06-14 17:59:08 +02:00
parent e99884e319
commit d0c59a3155
4 changed files with 27 additions and 24 deletions

View file

@ -52,6 +52,7 @@ class SbyProc:
self.finished = False
self.terminated = False
self.checkretcode = False
self.retcodes = [0]
self.task = task
self.info = info
self.deps = deps
@ -199,7 +200,7 @@ class SbyProc:
self.task.terminate()
return
if self.checkretcode and self.p.returncode != 0:
if self.checkretcode and self.p.returncode not in self.retcodes:
self.task.status = "ERROR"
if not self.silent:
self.task.log(f"{self.info}: task failed. ERROR.")