Commit 56f8215c authored by Chris Lamb's avatar Chris Lamb 💬

comparators.macho: Use `str.startswith(...)` over `str.index(...) == 0` to...

comparators.macho: Use `str.startswith(...)` over `str.index(...) == 0` to prevent a traceback if the filename cannot be found on the line. (Closes: #910540)
parent b596a405
Pipeline #21025 failed with stage
in 9 minutes and 57 seconds
......@@ -44,7 +44,7 @@ class Otool(Command):
def filter(self, line):
# Strip filename
prefix = '{}:'.format(self._path)
if line.decode('utf-8', 'ignore').index(prefix) == 0:
if line.decode('utf-8', 'ignore').startswith(prefix):
return line[len(prefix):].strip()
return line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment