Skip to content

Commit c587fcd

Browse files
author
ajohns
committed
Merge branch 'davidlatwe-fix-#1108'
2 parents 88918d7 + 4df71fd commit c587fcd

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/rez/plugin_managers.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from rez.utils.logging_ import print_debug, print_warning
99
from rez.vendor.six import six
1010
from rez.exceptions import RezPluginError
11+
from zipimport import zipimporter
1112
import pkgutil
1213
import os.path
1314
import sys
@@ -302,9 +303,22 @@ def rezplugins_module_paths(self):
302303
if not ispkg:
303304
continue
304305

305-
module_path = os.path.join(importer.path, name)
306-
if os.path.isdir(os.path.join(module_path, "rezplugins")):
307-
paths.append(module_path)
306+
if isinstance(importer, zipimporter):
307+
init_path = os.path.join(name, "rezplugins", "__init__.pyc")
308+
try:
309+
importer.get_data(init_path)
310+
except (IOError, OSError):
311+
continue
312+
else:
313+
module_path = os.path.join(importer.archive, name)
314+
315+
else:
316+
module_path = os.path.join(importer.path, name)
317+
init_path = os.path.join(module_path, "rezplugins", "__init__.py")
318+
if not os.path.isfile(init_path):
319+
continue
320+
321+
paths.append(module_path)
308322

309323
return paths
310324

0 commit comments

Comments
 (0)