Skip to content

Commit

Permalink
Merge branch 'davidlatwe-fix-#1108'
Browse files Browse the repository at this point in the history
  • Loading branch information
ajohns committed Aug 2, 2021
2 parents 88918d7 + 4df71fd commit c587fcd
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/rez/plugin_managers.py
Expand Up @@ -8,6 +8,7 @@
from rez.utils.logging_ import print_debug, print_warning
from rez.vendor.six import six
from rez.exceptions import RezPluginError
from zipimport import zipimporter
import pkgutil
import os.path
import sys
Expand Down Expand Up @@ -302,9 +303,22 @@ def rezplugins_module_paths(self):
if not ispkg:
continue

module_path = os.path.join(importer.path, name)
if os.path.isdir(os.path.join(module_path, "rezplugins")):
paths.append(module_path)
if isinstance(importer, zipimporter):
init_path = os.path.join(name, "rezplugins", "__init__.pyc")
try:
importer.get_data(init_path)
except (IOError, OSError):
continue
else:
module_path = os.path.join(importer.archive, name)

else:
module_path = os.path.join(importer.path, name)
init_path = os.path.join(module_path, "rezplugins", "__init__.py")
if not os.path.isfile(init_path):
continue

paths.append(module_path)

return paths

Expand Down

0 comments on commit c587fcd

Please sign in to comment.