Merge pull request #2232 from jdufresne/font-close-file

Close file after finished reading in ImageFont._load_pilfont()
This commit is contained in:
wiredfool 2016-11-22 11:59:36 +00:00 committed by GitHub
commit 806e5343d8

View File

@ -62,8 +62,7 @@ class ImageFont(object):
def _load_pilfont(self, filename):
fp = open(filename, "rb")
with open(filename, "rb") as fp:
for ext in (".png", ".gif", ".pbm"):
try:
fullname = os.path.splitext(filename)[0] + ext