Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
for #110: what about this?
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski committed Aug 7, 2018
1 parent b261b7a commit 59a6f79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions uproot/rootio.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
################################################################ high-level interface

def open(path, localsource=MemmapSource.defaults, xrootdsource=XRootDSource.defaults, httpsource=HTTPSource.defaults, **options):
if hasattr(path, "__fspath__"):
path = path.__fspath__()
if path.__class__.__module__ == "pathlib":
import pathlib
if isinstance(path, pathlib.Path):
Expand Down
2 changes: 2 additions & 0 deletions uproot/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ def _delayedraise(excinfo):
raise err.with_traceback(trc)

def _filename_explode(x):
if hasattr(x, "__fspath__"):
x = x.__fspath__()
if x.__class__.__module__ == "pathlib":
import pathlib
if isinstance(x, pathlib.Path):
Expand Down

0 comments on commit 59a6f79

Please sign in to comment.