From 77f294f2133098bb6e9a048eca25d382c140f1c0 Mon Sep 17 00:00:00 2001 From: Gregorio Litenstein Date: Tue, 16 Jul 2024 10:23:26 -0400 Subject: [PATCH] Pollute sys.path a tiny bit less MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don’t add duplicate entries, at least. --- deluge/pluginmanagerbase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deluge/pluginmanagerbase.py b/deluge/pluginmanagerbase.py index a286f29cdb..3adbb11afd 100644 --- a/deluge/pluginmanagerbase.py +++ b/deluge/pluginmanagerbase.py @@ -115,7 +115,7 @@ def scan_for_plugins(self): plugin_dirs = [str(f) for f in plugin_wheels + plugin_eggs if os.path.isfile(f)] plugin_dirs.extend([base_dir, user_dir] + base_subdir) - sys.path.extend(plugin_dirs) + [sys.path.append(item) for item in plugin_dirs if item not in sys.path] plugin_eps = entry_points(group=self.entry_name) self.available_plugins = [] for ep in plugin_eps: