From 77e28787343c80249cecb395e1333c48e15f3457 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 2 Jun 2015 00:09:18 +1000 Subject: [PATCH] Fixed redefining built-ins --- PIL/ImageFile.py | 4 ++-- PIL/ImageFont.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PIL/ImageFile.py b/PIL/ImageFile.py index b1d261166..cc1d73f09 100644 --- a/PIL/ImageFile.py +++ b/PIL/ImageFile.py @@ -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 ) diff --git a/PIL/ImageFont.py b/PIL/ImageFont.py index c6e7cb4d9..e3fb6f503 100644 --- a/PIL/ImageFont.py +++ b/PIL/ImageFont.py @@ -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):