Handle garbage in environment more gracefully when setting vsenv

Environment line may not contain '=' and thus fail to decompose into a
key/value pair.
pull/10653/head
Denis Fortin 2 years ago committed by Jussi Pakkanen
parent 27626124d0
commit e1bf8f0f0c
  1. 9
      mesonbuild/mesonlib/vsenv.py

@ -96,8 +96,13 @@ def _setup_vsenv(force: bool) -> bool:
continue
if not bat_line:
continue
k, v = bat_line.split('=', 1)
os.environ[k] = v
try:
k, v = bat_line.split('=', 1)
except ValueError:
# there is no "=", ignore junk data
pass
else:
os.environ[k] = v
return True
def setup_vsenv(force: bool = False) -> bool:

Loading…
Cancel
Save