Skip to content

Commit

Permalink
Handle pathlike objects on Python 3.5 also.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Dec 1, 2018
1 parent ee46788 commit 12a364e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test_zipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ def test_pathlike_construction(zipfile_ondisk):
"""
zipp.Path should be constructable from a path-like object
"""
zipp.Path(pathlib.Path(zipfile_ondisk))
pathlike = pathlib.Path(str(zipfile_ondisk))
zipp.Path(pathlike)
2 changes: 1 addition & 1 deletion zipp.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _pathlib_compat(path):
try:
return path.__fspath__()
except AttributeError:
return path
return str(path)

@property
def open(self):
Expand Down

0 comments on commit 12a364e

Please sign in to comment.