Skip to content

Commit

Permalink
Simplified code
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Feb 10, 2024
1 parent a118a82 commit 152a24e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -3240,10 +3240,8 @@ def open(fp, mode="r", formats=None) -> Image:

exclusive_fp = False
filename = ""
if isinstance(fp, os.PathLike):
if is_path(fp):
filename = os.path.realpath(os.fspath(fp))
elif is_path(fp):
filename = fp

if filename:
fp = builtins.open(filename, "rb")
Expand Down

0 comments on commit 152a24e

Please sign in to comment.