py3k: Integer long literals are no longer valid syntax

This commit is contained in:
Brian Crowell 2012-10-16 22:07:08 -05:00 committed by Brian Crowell
parent 260c1fad14
commit e2283c664b
4 changed files with 5 additions and 5 deletions

View File

@ -116,7 +116,7 @@ class PSFile:
def _accept(prefix):
return prefix[:4] == "%!PS" or i32(prefix) == 0xC6D3D0C5L
return prefix[:4] == "%!PS" or i32(prefix) == 0xC6D3D0C5
##
# Image plugin for Encapsulated Postscript. This plugin supports only
@ -141,7 +141,7 @@ class EpsImageFile(ImageFile.ImageFile):
offset = 0
fp.seek(0, 2)
length = fp.tell()
elif i32(s) == 0xC6D3D0C5L:
elif i32(s) == 0xC6D3D0C5:
offset = i32(s[4:])
length = i32(s[8:])
fp.seek(offset)

View File

@ -16,7 +16,7 @@
from . import Image, ImageFile
def i32(c):
return ord(c[3]) + (ord(c[2])<<8) + (ord(c[1])<<16) + (ord(c[0])<<24L)
return ord(c[3]) + (ord(c[2])<<8) + (ord(c[1])<<16) + (ord(c[0])<<24)
def _accept(prefix):
return i32(prefix) >= 20 and i32(prefix[4:8]) == 1

View File

@ -38,7 +38,7 @@ class BitStream:
continue
self.bitbuffer = (self.bitbuffer << 8) + c
self.bits = self.bits + 8
return self.bitbuffer >> (self.bits - bits) & (1L << bits) - 1
return self.bitbuffer >> (self.bits - bits) & (1 << bits) - 1
def skip(self, bits):
while self.bits < bits:

View File

@ -485,7 +485,7 @@ class OleFileIO:
value = long(i32(s, offset+4)) + (long(i32(s, offset+8))<<32)
# FIXME: this is a 64-bit int: "number of 100ns periods
# since Jan 1,1601". Should map this to Python time
value = value / 10000000L # seconds
value = value / 10000000 # seconds
elif type == VT_UI1:
value = ord(s[offset+4])
elif type == VT_CLSID: