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: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=910a08f6da226b892b8bfdb69c61b80386627fd2;p=thirdparty%2FPython%2Fcpython.git quick hack to fix busted binhex test --- diff --git a/Lib/binhex.py b/Lib/binhex.py index 16985fb16694..4f3882ac0671 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):