Skip to content

Commit

Permalink
suppress stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
proost committed Jul 19, 2017
1 parent 1e340c7 commit b090be4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cluster/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import re
import sys

from subprocess import check_output
from subprocess import check_output, DEVNULL
from time import sleep


Expand All @@ -13,15 +13,15 @@ def detect_cluster_system():
:return: string "SBE", "PBS" or "other"
"""
try:
which_output = check_output(["which", "sge_qmaster"]).decode("utf-8")
which_output = check_output(["which", "sge_qmaster"], stderr=DEVNULL).decode("utf-8")

if "/sge_qmaster" in which_output:
return "SGE"
except Exception as _:
pass

try:
which_output = check_output(["which", "pbs_sched"]).decode("utf-8")
which_output = check_output(["which", "pbs_sched"], stderr=DEVNULL).decode("utf-8")

if "/pbs_sched" in which_output:
return "PBS"
Expand Down

0 comments on commit b090be4

Please sign in to comment.