mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Removed duplicate code
This commit is contained in:
parent
894ff64cf1
commit
07a86bacc9
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue
Block a user