Removed duplicate code

This commit is contained in:
Andrew Murray 2017-09-06 13:14:39 +10:00
parent 894ff64cf1
commit 07a86bacc9

View File

@ -25,16 +25,9 @@
from . import ImageFile, ImagePalette
from ._binary import i16be as i16
from ._util import isPath
__version__ = "0.1"
try:
import builtins
except ImportError:
import __builtin__
builtins = __builtin__
##
# Image plugin for the GD uncompressed format. Note that this format
@ -78,13 +71,7 @@ def open(fp, mode="r"):
if mode != "r":
raise ValueError("bad mode")
if isPath(fp):
filename = fp
fp = builtins.open(fp, "rb")
else:
filename = ""
try:
return GdImageFile(fp, filename)
return GdImageFile(fp)
except SyntaxError:
raise IOError("cannot identify this image file")