File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -54,13 +54,14 @@ def check(self, *args) -> z3.CheckSatResult:
54
54
:return: The evaluated result which is either of sat, unsat or unknown
55
55
"""
56
56
old_stdout = sys .stdout
57
- sys .stdout = open (os .devnull , "w" )
58
- try :
59
- evaluate = self .raw .check (args )
60
- except z3 .z3types .Z3Exception as e :
61
- # Some requests crash the solver
62
- evaluate = z3 .unknown
63
- log .info (f"Encountered Z3 exception when checking the constraints: { e } " )
57
+ with open (os .devnull , "w" ) as dev_null_fd :
58
+ sys .stdout = dev_null_fd
59
+ try :
60
+ evaluate = self .raw .check (args )
61
+ except z3 .z3types .Z3Exception as e :
62
+ # Some requests crash the solver
63
+ evaluate = z3 .unknown
64
+ log .info (f"Encountered Z3 exception when checking the constraints: { e } " )
64
65
sys .stdout = old_stdout
65
66
return evaluate
66
67
You can’t perform that action at this time.
0 commit comments