You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try:
if self.report_level >= 1: #stderr & stdout to the terminal
handle = subprocess.Popen(urdme_solver_cmd)
else:
handle = subprocess.Popen(urdme_solver_cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
stdout, stderr = handle.communicate()
return_code = handle.wait()
except OSError as e:
print "Error, execution of solver raised an exception: {0}".format(e)
print "urdme_solver_cmd = {0}".format(urdme_solver_cmd) #<-- This message should be forwarded as an exception
if return_code != 0:
if self.report_level >= 1:
try:
print stderr, stdout
except Exception as e:
pass
print "urdme_solver_cmd = {0}".format(urdme_solver_cmd)
raise URDMEError("Solver execution failed, return code = {0}".format(return_code))
If an exception is raised by the solver, "return_code" is never initialized which leads to an UnboundLocalError exception (which is misleading since the problem comes from the solver). OSError should be forwarded instead.
The text was updated successfully, but these errors were encountered:
Aratz
added a commit
to Aratz/pyurdme
that referenced
this issue
Nov 2, 2016
Avoid UnboundLocalError in case solver execution throws an exception.
Information about the solver error is now passed within the
exception message.
fixahellander#157
Avoid UnboundLocalError in case solver execution throws an exception.
Information about the solver error is now passed within the
exception message.
fixahellander#157
In pyurdme.py (dev branch) from line 2289:
If an exception is raised by the solver, "return_code" is never initialized which leads to an UnboundLocalError exception (which is misleading since the problem comes from the solver). OSError should be forwarded instead.
The text was updated successfully, but these errors were encountered: