if which_prog not in self.version_cache:
with popen([which_prog, "--version"]) as exc:
exc["proc"].wait(timeout=5)
self.version_cache[which_prog] = safe_version(exc["stdout"].split()[2].strip("K"))
return self.version_cache[which_prog]
After Change
with popen([which_prog, "--version"]) as exc:
exc["proc"].wait(timeout=5)
mobj = re.search(NUMBER,exc["stdout"],re.VERBOSE)
version = mobj.group(0)
self.version_cache[which_prog] = safe_version(version)
return self.version_cache[which_prog]