py35: support for fspath(pathlib.Path())

This commit is contained in:
Mr. Outis
2019-12-03 18:38:15 -06:00
parent 285620d96e
commit 02eaa9a14f
+6
View File
@@ -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, "