Fixed redefining built-ins

This commit is contained in:
Andrew Murray 2015-06-02 00:09:18 +10:00
parent 40c05380c5
commit 77e2878734
2 changed files with 4 additions and 4 deletions

View File

@ -173,10 +173,10 @@ class ImageFile(Image.Image):
else:
# use mmap, if possible
import mmap
file = open(self.filename, "r+")
fp = open(self.filename, "r+")
size = os.path.getsize(self.filename)
# FIXME: on Unix, use PROT_READ etc
self.map = mmap.mmap(file.fileno(), size)
self.map = mmap.mmap(fp.fileno(), size)
self.im = Image.core.map_buffer(
self.map, self.size, d, e, o, a
)

View File

@ -67,7 +67,7 @@ class ImageFont(object):
def _load_pilfont(self, filename):
file = open(filename, "rb")
fp = open(filename, "rb")
for ext in (".png", ".gif", ".pbm"):
try:
@ -83,7 +83,7 @@ class ImageFont(object):
self.file = fullname
return self._load_pilfont_data(file, image)
return self._load_pilfont_data(fp, image)
def _load_pilfont_data(self, file, image):