Skip to content

Commit

Permalink
check whether any awk variant is installed (gawk, mawk, nawk, ..)
Browse files Browse the repository at this point in the history
  • Loading branch information
heller committed Oct 24, 2017
1 parent 8d4a769 commit d863570
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions bin/preprocess_dataset
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sys
import argparse
import threading
import os
from subprocess import call, check_call
from subprocess import call, check_call, CalledProcessError
from itertools import izip
from sshmm.structure_prediction import calculate_rna_shapes_from_file, calculate_rna_structures_from_file

Expand Down Expand Up @@ -91,14 +91,10 @@ def checkPrereqs():
raise

try:
check_call(["awk", "-V"], stdout=devnull, stderr=devnull)
except OSError as e:
if e.errno == os.errno.ENOENT:
print>>sys.stderr, "ERROR: awk not found. Tried to execute 'awk -V'."
return False
else:
# Something else went wrong while trying to run `awk`
raise
check_call(["which", "awk"], stdout=devnull, stderr=devnull)
except CalledProcessError as e:
print>>sys.stderr, "ERROR: awk not found. Tried to execute 'which awk'."
return False

try:
check_call(["RNAshapes", "-v"], stdout=devnull, stderr=devnull)
Expand Down

0 comments on commit d863570

Please sign in to comment.