Commit 56f8215c authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

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
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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