Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
ignore stderr output of theta
Browse files Browse the repository at this point in the history
In particular do not print it to the user's stderr
  • Loading branch information
saraedum committed Apr 11, 2016
1 parent 7b6df60 commit 0529a07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/sage/graphs/lovasz_theta.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ def is_functional(self):
tf_name = tmp_filename()
with open(tf_name, 'wb') as tf:
tf.write("2\n1\n1 1")
devnull = open(os.devnull, 'wb')
try:
lines = subprocess.check_output(['theta', tf_name])
lines = subprocess.check_output(['theta', tf_name], stderr=devnull)
except subprocess.CalledProcessError as e:
verbose("Call to theta failed with exit code %s and output:\n%s"%(e.returncode, lines), level=Feature.VERBOSE_LEVEL)
return False
Expand Down

0 comments on commit 0529a07

Please sign in to comment.