Skip to content

Commit 500c7a0

Browse files
committed
Fix Issue #61
Uses regular expression to detect the Version number
1 parent 2de4b3a commit 500c7a0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scorep/helper.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ def get_scorep_version():
4040
(return_code, std_out, std_err) = call(["scorep", "--version"])
4141
if (return_code != 0):
4242
raise RuntimeError("Cannot call Score-P, reason {}".format(std_err))
43-
version = float(std_out.lstrip("Score-P"))
43+
me = re.search("([0-9.]+)", std_out)
44+
version_str = me.group(1)
45+
try:
46+
version = float(version_str)
47+
except TypeError:
48+
raise RuntimeError(
49+
"Can not decode the Score-P Version. The version string is: \"{}\"".format(std_out))
4450
return version
4551

4652

0 commit comments

Comments
 (0)