Skip to content

Commit b98f9b9

Browse files
committed
Fixes a context matcher error
1 parent a33f574 commit b98f9b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

polyfile/magic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def get_resource_contents(package):
5656
return resources.contents(package)
5757
else:
5858
def get_resource_path(name: str) -> Path:
59-
return resources.as_file(resources.files(magic_defs).joinpath(name))
59+
with resources.as_file(resources.files(magic_defs).joinpath(name)) as f:
60+
return f
6061

6162
def get_resource_contents(package):
6263
return (resource.name for resource in resources.files(package).iterdir() if resource.is_file())

0 commit comments

Comments
 (0)