From 9c0323f656f742a858486de495e4a2b8f241ae41 Mon Sep 17 00:00:00 2001 From: loonghao Date: Mon, 15 Aug 2022 14:22:08 +0800 Subject: [PATCH 1/2] working with embedded python scanning rezplugins Signed-off-by: loonghao --- src/rez/plugin_managers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rez/plugin_managers.py b/src/rez/plugin_managers.py index 81de6294c..67e2461b1 100644 --- a/src/rez/plugin_managers.py +++ b/src/rez/plugin_managers.py @@ -317,7 +317,10 @@ def rezplugins_module_paths(self): module_path = os.path.join(importer.archive, name) else: - module_path = os.path.join(importer.path, name) + try: + module_path = os.path.join(importer.path, name) + except AttributeError: + continue init_path = os.path.join(module_path, "rezplugins", "__init__.py") if not os.path.isfile(init_path): continue From 943bb1dff652f5162bc49d60fdd3a4bf0e8b97d5 Mon Sep 17 00:00:00 2001 From: loonghao Date: Thu, 22 Sep 2022 10:51:34 +0800 Subject: [PATCH 2/2] add more description for ignore execution failures due to missing `importer.path`, Signed-off-by: loonghao --- src/rez/plugin_managers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rez/plugin_managers.py b/src/rez/plugin_managers.py index 813e25494..a5a16bc36 100644 --- a/src/rez/plugin_managers.py +++ b/src/rez/plugin_managers.py @@ -319,6 +319,8 @@ def rezplugins_module_paths(self): else: try: module_path = os.path.join(importer.path, name) + # Ignore execution failures due to missing `importer.path`, + # when rez is packaged as a single application via Pyinstaller or PyOxidizer. except AttributeError: continue init_path = os.path.join(module_path, "rezplugins", "__init__.py")