Skip to content

Commit

Permalink
Use temporary path variable in loop per @dirk-thomas 's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
scpeters committed Apr 28, 2014
1 parent 324ac93 commit 232d56b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmake/templates/_setup_util.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ def _prefix_env_variable(environ, name, paths, subfolders):
environ_paths = [path for path in value.split(os.pathsep) if path]
checked_paths = []
for path in paths:
path0 = path
if type(subfolders) != type([]):
subfolders = [subfolders]
for subfolder in subfolders:
path = path0
path_tmp = path
if subfolder:
path = os.path.join(path, subfolder)
path_tmp = os.path.join(path_tmp, subfolder)
# exclude any path already in env and any path we already added
if path not in environ_paths and path not in checked_paths:
checked_paths.append(path)
if path_tmp not in environ_paths and path_tmp not in checked_paths:
checked_paths.append(path_tmp)
prefix_str = os.pathsep.join(checked_paths)
if prefix_str != '' and environ_paths:
prefix_str += os.pathsep
Expand Down

0 comments on commit 232d56b

Please sign in to comment.