diff options
author | kali <kali@leap.se> | 2012-08-31 04:39:13 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-31 04:39:13 +0900 |
commit | 6c4012fc128c5af1b75cf33eef00590cf0e82438 (patch) | |
tree | a97f63556f2adfcce8b1a150c775626d7577c383 /src/leap/util/fileutil.py | |
parent | 3c59f021dde265bc314cd6b52d3aafbb8532b1ec (diff) |
deprecated configparser. closes #500
Diffstat (limited to 'src/leap/util/fileutil.py')
-rw-r--r-- | src/leap/util/fileutil.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/leap/util/fileutil.py b/src/leap/util/fileutil.py index 429e4b12..aef4cfe0 100644 --- a/src/leap/util/fileutil.py +++ b/src/leap/util/fileutil.py @@ -21,7 +21,7 @@ def extend_path(): # XXX add mac / win extended search paths? -def which(program): +def which(program, path=None): """ an implementation of which that extends the path with @@ -67,8 +67,10 @@ def which(program): else: # extended iterator # with extra path + if path is None: + path = os.environ['PATH'] extended_path = chain( - iter_path(os.environ["PATH"]), + iter_path(path), iter_path(extend_path())) for candidate in extended_path: if candidate is not None: |