mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Fixed redefining built-ins
This commit is contained in:
parent
40c05380c5
commit
77e2878734
|
@ -173,10 +173,10 @@ class ImageFile(Image.Image):
|
||||||
else:
|
else:
|
||||||
# use mmap, if possible
|
# use mmap, if possible
|
||||||
import mmap
|
import mmap
|
||||||
file = open(self.filename, "r+")
|
fp = open(self.filename, "r+")
|
||||||
size = os.path.getsize(self.filename)
|
size = os.path.getsize(self.filename)
|
||||||
# FIXME: on Unix, use PROT_READ etc
|
# 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.im = Image.core.map_buffer(
|
||||||
self.map, self.size, d, e, o, a
|
self.map, self.size, d, e, o, a
|
||||||
)
|
)
|
||||||
|
|
|
@ -67,7 +67,7 @@ class ImageFont(object):
|
||||||
|
|
||||||
def _load_pilfont(self, filename):
|
def _load_pilfont(self, filename):
|
||||||
|
|
||||||
file = open(filename, "rb")
|
fp = open(filename, "rb")
|
||||||
|
|
||||||
for ext in (".png", ".gif", ".pbm"):
|
for ext in (".png", ".gif", ".pbm"):
|
||||||
try:
|
try:
|
||||||
|
@ -83,7 +83,7 @@ class ImageFont(object):
|
||||||
|
|
||||||
self.file = fullname
|
self.file = fullname
|
||||||
|
|
||||||
return self._load_pilfont_data(file, image)
|
return self._load_pilfont_data(fp, image)
|
||||||
|
|
||||||
def _load_pilfont_data(self, file, image):
|
def _load_pilfont_data(self, file, image):
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user