Skip to content

Commit 47437eb

Browse files
committed
Added error message when broken mx/env file is encountered.
Signed-off-by: Stefan Marr <git@stefan-marr.de>
1 parent 780ff4c commit 47437eb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mxtool/mx.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,11 @@ def _load_env(self, mxDir):
609609
for line in f:
610610
line = line.strip()
611611
if len(line) != 0 and line[0] != '#':
612-
key, value = line.split('=', 1)
613-
os.environ[key.strip()] = expandvars_in_property(value.strip())
612+
try:
613+
key, value = line.split('=', 1)
614+
os.environ[key.strip()] = expandvars_in_property(value.strip())
615+
except:
616+
abort("mx/env could not be parsed. Make sure that each line contains a line similar to 'key=value'.")
614617

615618
def _post_init(self, opts):
616619
mxDir = join(self.dir, 'mx')

0 commit comments

Comments
 (0)