File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ def set_mod_paths(self, mod_paths=None):
342342 # make sure we don't have the same path twice, using nub
343343 if mod_paths is None :
344344 # no paths specified, so grab list of (existing) module paths from $MODULEPATH
345- self .mod_paths = [ p for p in nub (curr_module_paths ()) if os . path . exists ( p )]
345+ self .mod_paths = nub (curr_module_paths ())
346346 else :
347347 for mod_path in nub (mod_paths ):
348348 self .prepend_module_path (mod_path , set_mod_paths = False )
@@ -1475,8 +1475,8 @@ def curr_module_paths():
14751475 """
14761476 Return a list of current module paths.
14771477 """
1478- # avoid empty entries , which don't make any sense
1479- return [p for p in os .environ .get ('MODULEPATH' , '' ).split (':' ) if p ]
1478+ # avoid empty or nonexistent paths , which don't make any sense
1479+ return [p for p in os .environ .get ('MODULEPATH' , '' ).split (':' ) if p and os . path . exists ( p ) ]
14801480
14811481
14821482def mk_module_path (paths ):
You can’t perform that action at this time.
0 commit comments