From 910a08f6da226b892b8bfdb69c61b80386627fd2 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Fri, 26 May 2006 12:52:53 +0000 Subject: [PATCH] quick hack to fix busted binhex test --- Lib/binhex.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/binhex.py b/Lib/binhex.py index 16985fb1669..4f3882ac067 100644 --- a/Lib/binhex.py +++ b/Lib/binhex.py @@ -217,7 +217,11 @@ class BinHex: def _writecrc(self): # XXXX Should this be here?? # self.crc = binascii.crc_hqx('\0\0', self.crc) - self.ofp.write(struct.pack('>h', self.crc)) + if self.crc < 0: + fmt = '>h' + else: + fmt = '>H' + self.ofp.write(struct.pack(fmt, self.crc)) self.crc = 0 def write(self, data):