Use newer struct, which handles unsigned long right

This commit is contained in:
Guido van Rossum 1997-01-11 19:21:09 +00:00
parent fe27a50847
commit afe3ebfa5c
1 changed files with 1 additions and 3 deletions

View File

@ -199,9 +199,7 @@ def _write_short(f, x):
f.write(struct.pack('>h', x))
def _write_long(f, x):
if x >= 1L<<31:
x = x - (1L<<32)
f.write(struct.pack('>l', x))
f.write(struct.pack('>L', x))
def _write_string(f, s):
f.write(chr(len(s)))