diff --git a/HISTORY.rst b/HISTORY.rst index e1423599..a36f0409 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,10 +1,16 @@ Release Notes ============= -.. _release_notes_4_0: +.. _release_notes_4: + +PlatformIO Core 4 +----------------- + +4.2.1 (2020-02-??) +~~~~~~~~~~~~~~~~~~ + +* Fixed "TypeError: unsupported operand type(s)" when system environment variable is used by project configuration parser (`issue #3377 `_) -PlatformIO Core 4.0 -------------------- 4.2.0 (2020-02-12) ~~~~~~~~~~~~~~~~~~ @@ -182,8 +188,8 @@ PlatformIO Core 4.0 - Fixed "systemd-udevd" warnings in `99-platformio-udev.rules `__ (`issue #2442 `_) - Fixed an issue when package cache (Library Manager) expires too fast (`issue #2559 `_) -PlatformIO Core 3.0 -------------------- +PlatformIO Core 3 +----------------- 3.6.7 (2019-04-23) ~~~~~~~~~~~~~~~~~~ @@ -783,8 +789,8 @@ PlatformIO Core 3.0 (`issue #742 `_) * Stopped supporting Python 2.6 -PlatformIO Core 2.0 --------------------- +PlatformIO Core 2 +----------------- 2.11.2 (2016-08-02) ~~~~~~~~~~~~~~~~~~~ @@ -1569,8 +1575,8 @@ PlatformIO Core 2.0 * Fixed bug with creating copies of source files (`issue #177 `_) -PlatformIO Core 1.0 -------------------- +PlatformIO Core 1 +----------------- 1.5.0 (2015-05-15) ~~~~~~~~~~~~~~~~~~ @@ -1760,8 +1766,8 @@ PlatformIO Core 1.0 error (`issue #81 `_) * Several bug fixes, increased stability and performance improvements -PlatformIO Core 0.0 -------------------- +PlatformIO Core Preview +----------------------- 0.10.2 (2015-01-06) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/project/config.py b/platformio/project/config.py index 2e063fac..4dc3c38c 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -273,7 +273,9 @@ class ProjectConfigBase(object): if envvar_value: break if envvar_value and option_meta.multiple: - value += ("" if value == MISSING else "\n") + envvar_value + if value == MISSING: + value = "" + value += ("\n" if value else "") + envvar_value elif envvar_value and value == MISSING: value = envvar_value diff --git a/tests/test_projectconf.py b/tests/test_projectconf.py index 44731875..8172e692 100644 --- a/tests/test_projectconf.py +++ b/tests/test_projectconf.py @@ -185,6 +185,7 @@ def test_sysenv_options(config): assert config.get("env:base", "upload_port") is None assert config.get("env:extra_2", "upload_port") == "/dev/extra_2/port" os.environ["PLATFORMIO_BUILD_FLAGS"] = "-DSYSENVDEPS1 -DSYSENVDEPS2" + os.environ["PLATFORMIO_BUILD_UNFLAGS"] = "-DREMOVE_MACRO" os.environ["PLATFORMIO_UPLOAD_PORT"] = "/dev/sysenv/port" os.environ["__PIO_TEST_CNF_EXTRA_FLAGS"] = "-L /usr/local/lib" assert config.get("custom", "extra_flags") == "-L /usr/local/lib" @@ -194,6 +195,7 @@ def test_sysenv_options(config): ] assert config.get("env:base", "upload_port") == "/dev/sysenv/port" assert config.get("env:extra_2", "upload_port") == "/dev/extra_2/port" + assert config.get("env:base", "build_unflags") == ["-DREMOVE_MACRO"] # env var as option assert config.options(env="test_extends") == [ @@ -206,6 +208,7 @@ def test_sysenv_options(config): "lib_deps", "lib_ignore", "custom_builtin_option", + "build_unflags", "upload_port", ] @@ -215,6 +218,7 @@ def test_sysenv_options(config): # cleanup system environment variables del os.environ["PLATFORMIO_BUILD_FLAGS"] + del os.environ["PLATFORMIO_BUILD_UNFLAGS"] del os.environ["PLATFORMIO_UPLOAD_PORT"] del os.environ["__PIO_TEST_CNF_EXTRA_FLAGS"] del os.environ["PLATFORMIO_HOME_DIR"]