From 9fa424ea9b70df077d639196193e2eee2443718c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 28 Aug 2019 22:43:34 +0300 Subject: [PATCH] Remove ProjectConfig from cache on saving --- HISTORY.rst | 2 +- platformio/project/config.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index cc4e0b4a..902cac55 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -12,7 +12,7 @@ PlatformIO 4.0 * Update SCons tool to 3.1.1 * Remove ProjectConfig cache when "platformio.ini" was modified outside * Fixed an issue with PIO Unified Debugger on Windows OS when debug server is piped -* Fixed an issue when `--upload-port `__ CLI flag does not override declared `upload_port `_ option in `"platformio.ini" (Project Configuration File) `__ +* Fixed an issue when `--upload-port `__ CLI flag does not override declared `upload_port `__ option in `"platformio.ini" (Project Configuration File) `__ 4.0.2 (2019-08-23) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/project/config.py b/platformio/project/config.py index 9a23d494..6ca36a14 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -312,6 +312,9 @@ class ProjectConfig(object): return json.dumps(result) def save(self, path=None): + path = path or self.path + if path in self._instances: + del self._instances[path] with open(path or self.path, "w") as fp: fp.write(CONFIG_HEADER) self._parser.write(fp)