summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2006-05-26 12:52:53 (GMT)
committerBob Ippolito <bob@redivi.com>2006-05-26 12:52:53 (GMT)
commit910a08f6da226b892b8bfdb69c61b80386627fd2 (patch)
treeb6de0b73aa807be823265c8b734bde3db62eac53 /Lib
parentad0cb65fca0fbac51dbe32fb79adca2ed0c3dd31 (diff)
downloadcpython-910a08f6da226b892b8bfdb69c61b80386627fd2.zip
cpython-910a08f6da226b892b8bfdb69c61b80386627fd2.tar.gz
cpython-910a08f6da226b892b8bfdb69c61b80386627fd2.tar.bz2
quick hack to fix busted binhex test
Diffstat (limited to 'Lib')
-rw-r--r--Lib/binhex.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/binhex.py b/Lib/binhex.py
index 16985fb..4f3882a 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):