Avoid duplicates when finding plugin modules
Since PyInstaller added support for iter_modules in release 4.4, our previous hack just duplicates all modules. If this works as intended, we can remove our hack in the future.
This commit is contained in:
parent
5550217c02
commit
839deb03e8
1 changed files with 2 additions and 2 deletions
|
@ -22,11 +22,11 @@ def get_plugin_modules():
|
|||
@rtype: iterator of module
|
||||
"""
|
||||
prefix = plugin_package + "."
|
||||
modules = [m[1] for m in pkgutil.iter_modules(plugin_path, prefix)]
|
||||
modules = {m[1] for m in pkgutil.iter_modules(plugin_path, prefix)}
|
||||
|
||||
for elm in _get_all_modules_pyinstaller():
|
||||
if elm.startswith(prefix):
|
||||
modules.append(elm)
|
||||
modules.add(elm)
|
||||
|
||||
for name in modules:
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue