We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a33f574 commit b98f9b9Copy full SHA for b98f9b9
polyfile/magic.py
@@ -56,7 +56,8 @@ def get_resource_contents(package):
56
return resources.contents(package)
57
else:
58
def get_resource_path(name: str) -> Path:
59
- return resources.as_file(resources.files(magic_defs).joinpath(name))
+ with resources.as_file(resources.files(magic_defs).joinpath(name)) as f:
60
+ return f
61
62
def get_resource_contents(package):
63
return (resource.name for resource in resources.files(package).iterdir() if resource.is_file())
0 commit comments