You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after #4224, I may use the following code, for instance, to ensure variable is not set:
with environment_append({'CONAN_BASH_PATH': None}):
pass
however, it raises if CONAN_BASH_PATH is not set (prior to the environment_append invocation):
Traceback (most recent call last):
File "C:\bincrafters\conan\conans\test\unittests\client\tools\os_info\osinfo_test.py", line 39, in test_windows
with environment_append(new_env):
File "c:\users\sse4\appdata\local\programs\python\python36\lib\contextlib.py", line 81, in __enter__
return next(self.gen)
File "C:\bincrafters\conan\conans\client\tools\env.py", line 57, in environment_append
os.environ.pop(var)
File "c:\users\sse4\appdata\local\programs\python\python36\lib\_collections_abc.py", line 795, in pop
value = self[key]
File "c:\users\sse4\appdata\local\programs\python\python36\lib\os.py", line 669, in __getitem__
raise KeyError(key) from None
KeyError: 'CONAN_BASH_PATH'
I would expect tools.environment_append to be no op in such case, otherwise, it requires additional logic to workaround this behavior.
SSE4
changed the title
tools.environment_append raises if tries to unset variables which was never set
tools.environment_append raises if tries to unset variable which was never set
Jan 16, 2019
after #4224, I may use the following code, for instance, to ensure variable is not set:
however, it raises if
CONAN_BASH_PATH
is not set (prior to the environment_append invocation):I would expect
tools.environment_append
to be no op in such case, otherwise, it requires additional logic to workaround this behavior.To help us debug your issue please explain:
The text was updated successfully, but these errors were encountered: