From a1491c3c4749a0db31dfd9cf4ea8c87af5905a28 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 29 Oct 2010 01:14:16 +0000 Subject: [PATCH] test/Scripts/macho-dump: Make hack for Python-2.4. [PR7995] 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. llvm-svn: 117637 --- test/Scripts/macho-dump | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/Scripts/macho-dump b/test/Scripts/macho-dump index afef2ba5043..8c9fa59c601 100755 --- a/test/Scripts/macho-dump +++ b/test/Scripts/macho-dump @@ -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: