File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,10 @@ def path(package, resource):
108
108
raised if the file was deleted prior to the context manager
109
109
exiting).
110
110
"""
111
- return trees .as_file (get (package , resource ))
111
+ path = get (package , resource )
112
+ if not path .is_file ():
113
+ raise FileNotFoundError (path )
114
+ return trees .as_file (path )
112
115
113
116
114
117
def is_resource (package , name ):
Original file line number Diff line number Diff line change @@ -89,8 +89,6 @@ def as_file(path):
89
89
Given a path-like object, return that object as a
90
90
path on the local file system in a context manager.
91
91
"""
92
- if not path .is_file ():
93
- raise FileNotFoundError (path )
94
92
# todo: consider using functools.singledispatch
95
93
wrapper = (
96
94
_zip_path_as_file
You can’t perform that action at this time.
0 commit comments