From ddd7d15287ad915d58fea05fc9059ddb6e3c170d Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Wed, 25 Mar 2020 17:45:42 +0100 Subject: [PATCH] Attempt to appease mypy --- plugins/PostProcessingPlugin/PostProcessingPlugin.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/PostProcessingPlugin/PostProcessingPlugin.py b/plugins/PostProcessingPlugin/PostProcessingPlugin.py index 3f3ac9f6af..f4f0e23378 100644 --- a/plugins/PostProcessingPlugin/PostProcessingPlugin.py +++ b/plugins/PostProcessingPlugin/PostProcessingPlugin.py @@ -348,10 +348,11 @@ class PostProcessingPlugin(QObject, Extension): # No signature needed return True - dir_path = os.path.split(file_path)[0] - if dir_path == os.path.join( - PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin"), - "scripts"): + dir_path = os.path.split(file_path)[0] # type: str + plugin_path = PluginRegistry.getInstance().getPluginPath("PostProcessingPlugin") + assert plugin_path is not None # appease mypy + bundled_path = os.path.join(plugin_path, "scripts") + if dir_path == bundled_path: # Bundled scripts are trusted. return True