From 07a86bacc977d3b699586bcacf880b9c7531643b Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 6 Sep 2017 13:14:39 +1000 Subject: [PATCH] Removed duplicate code --- src/PIL/GdImageFile.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/PIL/GdImageFile.py b/src/PIL/GdImageFile.py index 09ab5ec69..5b7dc3d76 100644 --- a/src/PIL/GdImageFile.py +++ b/src/PIL/GdImageFile.py @@ -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")