mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
py35: support for fspath(pathlib.Path())
This commit is contained in:
@@ -207,6 +207,12 @@ except ImportError:
|
||||
except AttributeError:
|
||||
if hasattr(path_type, "__fspath__"):
|
||||
raise
|
||||
|
||||
# Support for pathlib.Path in Python 3.5, since it doesn't
|
||||
# implement `__fspath__`
|
||||
if isinstance(path, pathlib.Path):
|
||||
return str(path)
|
||||
|
||||
else:
|
||||
raise TypeError(
|
||||
"expected str, bytes or os.PathLike object, "
|
||||
|
||||
Reference in New Issue
Block a user