reduce use of pkg_resources by not extracting a file to find its filename

Further progress on #4467
This commit is contained in:
Eli Schwartz 2020-12-07 11:54:38 -05:00
parent 2e65f731b1
commit 0a9cfaa35a
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
1 changed files with 1 additions and 2 deletions

View File

@ -118,8 +118,7 @@ class Environment(jinja2.Environment):
def _data_url(self, path: str) -> str:
"""Get a data: url for the broken qutebrowser logo."""
data = utils.read_file(path, binary=True)
filename = utils.resource_filename(path)
mimetype = utils.guess_mimetype(filename)
mimetype = utils.guess_mimetype(path)
return urlutils.data_url(mimetype, data).toString()
def getattr(self, obj: Any, attribute: str) -> Any: