mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Fixed to use PathLike in imghdr.py
This commit is contained in:
1 parent
101fd80949
commit
20cb4aca69
1 file changed
+2
-3
Vendored
+2
-3
@@ -1,6 +1,6 @@
|
||||
"""Recognize image file formats based on their first few bytes."""
|
||||
|
||||
#from os import PathLike
|
||||
from os import PathLike
|
||||
|
||||
__all__ = ["what"]
|
||||
|
||||
@@ -14,8 +14,7 @@ def what(file, h=None):
|
||||
f = None
|
||||
try:
|
||||
if h is None:
|
||||
# if isinstance(file, (str, PathLike))
|
||||
if isinstance(file, str): # FIXME(corona10): RustPython doesn't support PathLike yet.
|
||||
if isinstance(file, (str, PathLike)):
|
||||
f = FileIO(file, 'rb')
|
||||
h = f.read(32)
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user