eric6/DebugClients/Python/DebugClientBase.py

branch
maintenance
changeset 8142
43248bafe9b2
parent 8043
0acf98cd089a
parent 8075
6774034a1e0f
child 8176
31965986ecd1
diff -r 874fdd14d3a2 -r 43248bafe9b2 eric6/DebugClients/Python/DebugClientBase.py
--- a/eric6/DebugClients/Python/DebugClientBase.py	Mon Feb 01 10:38:43 2021 +0100
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Tue Mar 02 17:12:08 2021 +0100
@@ -403,10 +403,17 @@
         elif method == "RequestEnvironment":
             for key, value in params["environment"].items():
                 if key.endswith("+"):
-                    if key[:-1] in os.environ:
-                        os.environ[key[:-1]] += value
+                    # append to the key
+                    key = key[:-1]
+                    if key in os.environ:
+                        os.environ[key] += value
                     else:
-                        os.environ[key[:-1]] = value
+                        os.environ[key] = value
+                elif key.endswith("-"):
+                    # delete the key if it exists
+                    key = key[:-1]
+                    if key in os.environ:
+                        del os.environ[key]
                 else:
                     os.environ[key] = value
         

eric ide

mercurial