X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=scripts%2Ftracediff2.py;h=255191e8c5bf93bd9a744ef558b4c28e7f386e2d;hb=77653bfda5aff9930096d1ca2db9db13eeabe2ac;hp=38720718c7534d92bf18342c20fa2678371f37c1;hpb=7ec3ffe6d6d8d6af5926ac66e34fdd7174a489c2;p=apitrace diff --git a/scripts/tracediff2.py b/scripts/tracediff2.py index 3872071..255191e 100755 --- a/scripts/tracediff2.py +++ b/scripts/tracediff2.py @@ -58,7 +58,7 @@ class Blob: return 'blob(%u)' % self.size def __eq__(self, other): - return self.size == other.size and self.hash == other.hash + return isinstance(other, Blob) and self.size == other.size and self.hash == other.hash def __hash__(self): return self.hash @@ -166,16 +166,24 @@ class SDiffer: a_call = self.a[alo + i] b_call = self.b[blo + i] assert a_call.functionName == b_call.functionName - assert len(a_call.args) == len(b_call.args) self.dumpCallNos(a_call.no, b_call.no) self.highlighter.bold(True) self.highlighter.write(b_call.functionName) self.highlighter.bold(False) self.highlighter.write('(') sep = '' - for j in xrange(len(b_call.args)): + numArgs = max(len(a_call.args), len(b_call.args)) + for j in xrange(numArgs): self.highlighter.write(sep) - self.replace_value(a_call.args[j], b_call.args[j]) + try: + a_arg = a_call.args[j] + except IndexError: + pass + try: + b_arg = b_call.args[j] + except IndexError: + pass + self.replace_value(a_arg, b_arg) sep = ', ' self.highlighter.write(')') if a_call.ret is not None or b_call.ret is not None: