File tree 1 file changed +17
-3
lines changed 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 8
8
from rez .utils .logging_ import print_debug , print_warning
9
9
from rez .vendor .six import six
10
10
from rez .exceptions import RezPluginError
11
+ from zipimport import zipimporter
11
12
import pkgutil
12
13
import os .path
13
14
import sys
@@ -302,9 +303,22 @@ def rezplugins_module_paths(self):
302
303
if not ispkg :
303
304
continue
304
305
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 )
308
322
309
323
return paths
310
324
You can’t perform that action at this time.
0 commit comments