Skip to content

Commit

Permalink
test/Scripts/macho-dump: Make hack for Python-2.4. [PR7995]
Browse files Browse the repository at this point in the history
With Python-2.4, Reader::read64 always returns (unexpected) long integer.
FileCheck detects failure on test/MC/MachO among '0' and '0L'.

CentOS5(aka RHEL5 clone) provides python-2.4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117637 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
chapuni committed Oct 29, 2010
1 parent cd5c123 commit b087c84
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/Scripts/macho-dump
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class Reader:
return int(Value)

def read64(self):
return struct.unpack('><'[self.isLSB] + 'Q', self.read(8))[0]
Value = struct.unpack('><'[self.isLSB] + 'Q', self.read(8))[0]
if Value == int(Value):
Value = int(Value)
return Value

def registerStringTable(self, strings):
if self.string_table is not None:
Expand Down

0 comments on commit b087c84

Please sign in to comment.