Skip to content

Commit 0174919

Browse files
committed
Merge branch 'configs_fixes' into develop
2 parents f5a0e85 + 996007f commit 0174919

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

etc/getconf.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
- python scripts execution
3838
- shell scripts execution
3939
40+
On posix, posix Python and shell scripts are executed before mac or linux
41+
scripts.
42+
4043
For example a tree could be looking like this::
4144
etc/conf
4245
base.txt : base pip requirements for all platforms
@@ -70,7 +73,7 @@
7073
elif 'cygwin' in sys_platform:
7174
platform_names = ('posix', 'cygwin',)
7275
else:
73-
# raise Exception('Unsupported OS/platform')
76+
print('Unsupported OS/platform')
7477
platform_names = tuple()
7578

7679

@@ -128,9 +131,14 @@ def get_conf_files(config_dir_paths, file_names=requirements):
128131
os.path.join(base_loc, path),)
129132

130133
path, loc = current
131-
collected += [os.path.join(path, f)
132-
for f in os.listdir(loc) if f in file_names
133-
and os.path.join(path, f) not in collected]
134+
# we iterate on filenames to ensure the precedence of posix over
135+
# mac, linux, etc is repsected
136+
for n in file_names:
137+
for f in os.listdir(loc):
138+
if f == n:
139+
f_loc = os.path.join(path, f)
140+
if f_loc not in collected:
141+
collected.append(f_loc)
134142

135143
return collected
136144

0 commit comments

Comments
 (0)