Skip to content
Snippets Groups Projects
Commit ca0c82a1 authored by chsieh16's avatar chsieh16
Browse files

Handle KeyboardInterupt to terminate

parent b6795d1f
No related branches found
No related tags found
No related merge requests found
......@@ -177,6 +177,9 @@ def main():
result.append({"part": part,
"status": "not found",
"result": ret})
except KeyboardInterrupt:
print("User pressed Ctrl+C. Skip all remaining partition.")
break # NOTE finally block is executed before break
except Exception as e:
result.append({"part": part,
"status": "exception",
......
......@@ -140,9 +140,10 @@ class DTreeGEMStanleyGurobiTeacher(GEMStanleyGurobiTeacher):
else:
# raise RuntimeError(f"Only found spurious cexs {cex_list} for the conjunct {conjunct}.")
pass
elif self._gp_model.status == gp.GRB.INFEASIBLE:
continue
elif self._gp_model.status == gp.GRB.INTERRUPTED:
raise KeyboardInterrupt
else:
return z3.unknown
print("Done")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment