From 839deb03e8c68f92cd50662ba8e910b79e86f3c7 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Sat, 28 May 2022 21:05:12 +0200 Subject: [PATCH] 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. --- dosagelib/loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dosagelib/loader.py b/dosagelib/loader.py index f04f1615c..3c6630a9e 100644 --- a/dosagelib/loader.py +++ b/dosagelib/loader.py @@ -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: