From 15f67e43c92b41de624a6ce9d85c84fec887b62d Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Wed, 16 Jan 2019 12:53:47 +0100 Subject: [PATCH] fix regular expression to determine BLAST version Some BLAST version have a leading whitespace, the regex didn't match in those cases. Thanks to Andrius Merkys for the proposed fix. --- modules/bindings/pymod/blast.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/bindings/pymod/blast.py b/modules/bindings/pymod/blast.py index 08359de4d..0a51c1ed8 100644 --- a/modules/bindings/pymod/blast.py +++ b/modules/bindings/pymod/blast.py @@ -186,11 +186,11 @@ def BlastVersion(blast_location=None): if os.path.basename(blast_exe)=='blastall': args=[blast_exe] - pattern=re.compile(r'blastall (\d+\.\d+\.\d+)\s+arguments:\s*') + pattern=re.compile(r'\s*blastall (\d+\.\d+\.\d+)\s+arguments:\s*') else: args=[blast_exe, '-version'] - pattern=re.compile(r'Package: blast (\d+\.\d+\.\d+),\s+') + pattern=re.compile(r'\s*Package: blast (\d+\.\d+\.\d+),\s+') blast_pipe=subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE) -- GitLab