Permalink
Browse files

When specifying env. var. then don't search elsewhere.

  • Loading branch information...
1 parent cf3ef30 commit 957cf7970b0d2b2c600ae6459fb45db8ef498de1 @pearu pearu committed Oct 9, 2004
Showing with 7 additions and 2 deletions.
  1. +7 −2 scipy_distutils/system_info.py
@@ -341,6 +341,7 @@ def get_info(self,notfound_action=0):
def get_paths(self, section, key):
dirs = self.cp.get(section, key).split(os.pathsep)
if self.dir_env_var and os.environ.has_key(self.dir_env_var):
+ dirs = []
d = os.environ[self.dir_env_var]
if d=='None':
print 'Disabled',self.__class__.__name__,'(%s is None)' % (self.dir_env_var)
@@ -359,6 +360,9 @@ def get_paths(self, section, key):
ds = d.split(os.pathsep)
ds2 = []
for d in ds:
+ if d.endswith(os.sep):
+ d = d[:-len(os.sep)]
+ if not d: d = os.sep
if os.path.isdir(d):
ds2.append(d)
for dd in ['include','lib']:
@@ -368,8 +372,9 @@ def get_paths(self, section, key):
if os.path.basename(d)=='lib':
ds2.append(os.path.join(os.path.dirname(d),'include'))
dirs = ds2 + dirs
- default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)
- dirs.extend(default_dirs)
+ else:
+ default_dirs = self.cp.get('DEFAULT', key).split(os.pathsep)
+ dirs.extend(default_dirs)
ret = []
[ret.append(d) for d in dirs if os.path.isdir(d) and d not in ret]
if self.verbosity>1:

0 comments on commit 957cf79

Please sign in to comment.