I have a file containing a list of installed packages, one per line. The method below should return True if a match is found in the file. However I get
this error output. I guess there is an issue with concatenating strings in re.compile()? What gives?
Code:
def package_is_installed(self, path):
pkg_name = path.split("/")[1]
pkg_search = re.compile(r"^" + pkg_name + r"-.*SBo")
self.inst_file.seek(0)
for line in self.inst_file:
if pkg_search.search(line):
return True
return False