mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Simplified code
This commit is contained in:
parent
a118a82c30
commit
152a24e13a
|
@ -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")
|
||||
|
|
Loading…
Reference in New Issue
Block a user