From: Bob Ippolito Date: Fri, 26 May 2006 12:52:53 +0000 (+0000) Subject: quick hack to fix busted binhex test X-Git-Tag: v2.5b1~475 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=910a08f6da226b892b8bfdb69c61b80386627fd2;p=python quick hack to fix busted binhex test --- diff --git a/Lib/binhex.py b/Lib/binhex.py index 16985fb166..4f3882ac06 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):