Make test.test_support.EnvironmentVarGuard behave like a dictionary.
All changes are mirrored to the underlying os.environ dict, but rolled back
on exit from the with block.
diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py
index d38b74a..8d527c3 100644
--- a/Lib/test/test_xmlrpc.py
+++ b/Lib/test/test_xmlrpc.py
@@ -605,7 +605,7 @@
def test_cgi_get(self):
with test_support.EnvironmentVarGuard() as env:
- env.set('REQUEST_METHOD', 'GET')
+ env['REQUEST_METHOD'] = 'GET'
# if the method is GET and no request_text is given, it runs handle_get
# get sysout output
tmp = sys.stdout
@@ -646,7 +646,7 @@
sys.stdout = open(test_support.TESTFN, "w")
with test_support.EnvironmentVarGuard() as env:
- env.set('CONTENT_LENGTH', str(len(data)))
+ env['CONTENT_LENGTH'] = str(len(data))
self.cgi.handle_request()
sys.stdin.close()