Skip to content

Commit 152a24e

Browse files
committed
Simplified code
1 parent a118a82 commit 152a24e

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/PIL/Image.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3240,10 +3240,8 @@ def open(fp, mode="r", formats=None) -> Image:
32403240

32413241
exclusive_fp = False
32423242
filename = ""
3243-
if isinstance(fp, os.PathLike):
3243+
if is_path(fp):
32443244
filename = os.path.realpath(os.fspath(fp))
3245-
elif is_path(fp):
3246-
filename = fp
32473245

32483246
if filename:
32493247
fp = builtins.open(filename, "rb")

0 commit comments

Comments
 (0)