mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +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