In Python, you can change the environment by writing to os.environ. This seems to already be handled correctly in the python 3 type data, so we just need to fix it for 2.7.