diff options
| author | Xavier Claessens <xclaessens@netflix.com> | 2025-09-05 16:06:36 -0400 |
|---|---|---|
| committer | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-09-06 15:06:40 +0300 |
| commit | 4b7a23c047ef5139f84cf96da37d132fe5fd84bc (patch) | |
| tree | 9f9926eceee899fdc76244f04011be1b02cacdaf /mesonbuild/utils | |
| parent | 94300ce8a7e85116c0f2f53a4b57a5bf6ac7e47a (diff) | |
| download | meson-4b7a23c047ef5139f84cf96da37d132fe5fd84bc.tar.gz | |
vsenv: Ignore errors when parsing multiline env values
Diffstat (limited to 'mesonbuild/utils')
| -rw-r--r-- | mesonbuild/utils/vsenv.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mesonbuild/utils/vsenv.py b/mesonbuild/utils/vsenv.py index 5a023794b..87bd3db00 100644 --- a/mesonbuild/utils/vsenv.py +++ b/mesonbuild/utils/vsenv.py @@ -113,7 +113,17 @@ def _setup_vsenv(force: bool) -> bool: # there is no "=", ignore junk data pass else: - os.environ[k] = v + try: + os.environ[k] = v + except ValueError: + # FIXME: When a value contains a newline, the output of SET + # command is impossible to parse because it makes not escaping. + # `VAR="Hello\n=World"` gets split into two lines: + # `VAR=Hello` and `=World`. That 2nd line will cause ValueError + # exception here. Just ignore for now because variables we do + # care won't have multiline values. + pass + return True def setup_vsenv(force: bool = False) -> bool: |
