Skip to content

Commit

Permalink
Fixes a context matcher error
Browse files Browse the repository at this point in the history
  • Loading branch information
ESultanik committed Nov 29, 2023
1 parent a33f574 commit b98f9b9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion polyfile/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def get_resource_contents(package):
return resources.contents(package)
else:
def get_resource_path(name: str) -> Path:
return resources.as_file(resources.files(magic_defs).joinpath(name))
with resources.as_file(resources.files(magic_defs).joinpath(name)) as f:
return f

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

0 comments on commit b98f9b9

Please sign in to comment.