Commit 045d5143 authored by Jonas Schwab's avatar Jonas Schwab
Browse files

tweak getenv

parent d2231665
......@@ -8,6 +8,7 @@ __copyright__ = "Copyright 2020, The ALF Project"
__license__ = "GPL"
import os
import re
import subprocess
from shutil import copyfile
import numpy as np
......@@ -258,9 +259,12 @@ def getenv(config, alf_dir='.'):
lines = f.readlines()
env = {}
for line in lines:
item = line.strip().split("=", 1)
if len(item) == 2:
env[item[0]] = item[1]
if (not re.search(r"^BASH_FUNC.*%%=()", line)) and '=' in line:
item = line.strip().split("=", 1)
if len(item) == 2:
env[item[0]] = item[1]
else:
env[item[0]] = ''
return env
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment