[pypy-svn] r78117 - pypy/trunk/pypy/module/imp/test

antocuni at codespeak.net antocuni at codespeak.net
Wed Oct 20 12:01:04 CEST 2010


Author: antocuni
Date: Wed Oct 20 12:01:02 2010
New Revision: 78117

Modified:
   pypy/trunk/pypy/module/imp/test/test_import.py
Log:
make sure that LANG is unset when calling py.py through py.process.cmdexec.
This is a workaround for pylib bug #130:
http://bitbucket.org/hpk42/py-trunk/issue/130/pyprocesscmdexec-fails-if-the-out-err-contains-non-ascii



Modified: pypy/trunk/pypy/module/imp/test/test_import.py
==============================================================================
--- pypy/trunk/pypy/module/imp/test/test_import.py	(original)
+++ pypy/trunk/pypy/module/imp/test/test_import.py	Wed Oct 20 12:01:02 2010
@@ -790,6 +790,7 @@
     extrapath = udir.ensure("pythonpath", dir=1) 
     extrapath.join("urllib.py").write("print 42\n")
     old = os.environ.get('PYTHONPATH', None)
+    oldlang = os.environ.pop('LANG', None)
     try: 
         os.environ['PYTHONPATH'] = str(extrapath)
         output = py.process.cmdexec('''"%s" "%s" -c "import urllib"''' % 
@@ -798,6 +799,8 @@
     finally: 
         if old: 
             os.environ['PYTHONPATH'] = old 
+        if oldlang:
+            os.environ['LANG'] = oldlang
 
 class AppTestImportHooks(object):
     def test_meta_path(self):



More information about the Pypy-commit mailing list