summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_gettext.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2009-05-01 19:58:58 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2009-05-01 19:58:58 (GMT)
commit155374d95d8ecd235d3a3edd92dd6f6a23d59f11 (patch)
tree91deb4c1d292387d2b216d869e79311cad1dbc61 /Lib/test/test_gettext.py
parent33841c34896834daa8ee38d3ff54d7800b9723c2 (diff)
downloadcpython-155374d95d8ecd235d3a3edd92dd6f6a23d59f11.zip
cpython-155374d95d8ecd235d3a3edd92dd6f6a23d59f11.tar.gz
cpython-155374d95d8ecd235d3a3edd92dd6f6a23d59f11.tar.bz2
Merged revisions 72167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines 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. ........
Diffstat (limited to 'Lib/test/test_gettext.py')
-rw-r--r--Lib/test/test_gettext.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_gettext.py b/Lib/test/test_gettext.py
index 6ee608e..e26b30a 100644
--- a/Lib/test/test_gettext.py
+++ b/Lib/test/test_gettext.py
@@ -58,10 +58,6 @@ LOCALEDIR = os.path.join('xx', 'LC_MESSAGES')
MOFILE = os.path.join(LOCALEDIR, 'gettext.mo')
UMOFILE = os.path.join(LOCALEDIR, 'ugettext.mo')
MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo')
-try:
- LANG = os.environ['LANGUAGE']
-except:
- LANG = 'en'
class GettextBaseTest(unittest.TestCase):
@@ -77,10 +73,12 @@ class GettextBaseTest(unittest.TestCase):
fp = open(MMOFILE, 'wb')
fp.write(base64.decodestring(MMO_DATA))
fp.close()
- os.environ['LANGUAGE'] = 'xx'
+ self.env = support.EnvironmentVarGuard()
+ self.env['LANGUAGE'] = 'xx'
def tearDown(self):
- os.environ['LANGUAGE'] = LANG
+ self.env.__exit__()
+ del self.env
shutil.rmtree(os.path.split(LOCALEDIR)[0])