[pypy-svn] r27536 - pypy/dist/pypy/translator/cli/test

antocuni at codespeak.net antocuni at codespeak.net
Sun May 21 15:32:13 CEST 2006


Author: antocuni
Date: Sun May 21 15:32:02 2006
New Revision: 27536

Modified:
   pypy/dist/pypy/translator/cli/test/compile.py
   pypy/dist/pypy/translator/cli/test/runtest.py
Log:
Fixed a bug that prevented some tests to pass on system with
non-english locales.



Modified: pypy/dist/pypy/translator/cli/test/compile.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/compile.py	(original)
+++ pypy/dist/pypy/translator/cli/test/compile.py	Sun May 21 15:32:02 2006
@@ -31,14 +31,12 @@
 def foo(a, b):
     pass
 
-from pypy.rpython.rarithmetic import ovfcheck
-
 def bar(x, y):
-    try:
-        l = [x, y]
-        return l[0]
-    except IndexError:
-        return 0
+    if x:
+        return 1
+    else:
+        return None
+    
 
 f = compile_function(bar, [int, int])
 

Modified: pypy/dist/pypy/translator/cli/test/runtest.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/runtest.py	(original)
+++ pypy/dist/pypy/translator/cli/test/runtest.py	Sun May 21 15:32:02 2006
@@ -98,6 +98,7 @@
             t.graphs.insert(0, graph)
         else:
             t.buildannotator().build_types(func, annotation)
+            
         t.buildrtyper(type_system="ootype").specialize()
         self.graph = t.graphs[0]
 
@@ -131,7 +132,10 @@
             py.test.skip("Compilation disabled")
 
         arglist = SDK.runtime() + [self._exe] + map(str, args)
-        mono = subprocess.Popen(arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+        env = os.environ.copy()
+        env['LANG'] = 'C'        
+        mono = subprocess.Popen(arglist, stdout=subprocess.PIPE,
+                                stderr=subprocess.PIPE, env=env)
         stdout, stderr = mono.communicate()
         retval = mono.wait()
         assert retval == 0, stderr



More information about the Pypy-commit mailing list