Make sure we always yield full names
This commit is contained in:
parent
6bc771151f
commit
bb115afc1a
@ -32,7 +32,7 @@ def get_data_files():
|
||||
def get_hidden_imports():
|
||||
imports = ['PyQt5.QtOpenGL', 'PyQt5._QOpenGLFunctions_2_0']
|
||||
for info in loader.walk_components():
|
||||
imports.append('qutebrowser.components.' + info.name)
|
||||
imports.append(info.name)
|
||||
return imports
|
||||
|
||||
|
||||
|
@ -51,13 +51,19 @@ def walk_components() -> typing.Iterator[ComponentInfo]:
|
||||
yield from _walk_normal()
|
||||
|
||||
|
||||
def _walk_error(name: str):
|
||||
raise ImportError("Failed to import {}".format(name))
|
||||
|
||||
|
||||
def _walk_normal() -> typing.Iterator[ComponentInfo]:
|
||||
"""Walk extensions when not using PyInstaller."""
|
||||
for _finder, name, ispkg in pkgutil.walk_packages(components.__path__):
|
||||
for _finder, name, ispkg in pkgutil.walk_packages(
|
||||
path=components.__path__,
|
||||
prefix=components.__name__ + '.',
|
||||
onerror=_walk_error):
|
||||
if ispkg:
|
||||
continue
|
||||
fullname = components.__name__ + '.' + name
|
||||
yield ComponentInfo(name=fullname)
|
||||
yield ComponentInfo(name=name)
|
||||
|
||||
|
||||
def _walk_pyinstaller() -> typing.Iterator[ComponentInfo]:
|
||||
|
Loading…
Reference in New Issue
Block a user