quick hack to fix busted binhex test

This commit is contained in:
Bob Ippolito 2006-05-26 12:52:53 +00:00
parent ad0cb65fca
commit 910a08f6da
1 changed files with 5 additions and 1 deletions

View File

@ -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):