Author: Carl Friedrich Bolz cfb...@gmx.de
Branch: set-strategies
Changeset: r49402:c3ed604fcfb5
Date: 2011-11-14 15:15 +0100
http://bitbucket.org/pypy/pypy/changeset/c3ed604fcfb5/
Log:merge
diff --git a/lib-python/modified-2.7/test/test_import.py
b/lib-python/modified-2.7/test/test_import.py
--- a/lib-python/modified-2.7/test/test_import.py
+++ b/lib-python/modified-2.7/test/test_import.py
@@ -64,6 +64,7 @@
except ImportError, err:
self.fail(import from %s failed: %s % (ext, err))
else:
+# XXX importing .pyw is missing on Windows
self.assertEqual(mod.a, a,
module loaded (%s) but contents invalid % mod)
self.assertEqual(mod.b, b,
diff --git a/lib-python/modified-2.7/test/test_repr.py
b/lib-python/modified-2.7/test/test_repr.py
--- a/lib-python/modified-2.7/test/test_repr.py
+++ b/lib-python/modified-2.7/test/test_repr.py
@@ -254,8 +254,14 @@
eq = self.assertEqual
touch(os.path.join(self.subpkgname, self.pkgname + os.extsep + 'py'))
from
areallylongpackageandmodulenametotestreprtruncation.areallylongpackageandmodulenametotestreprtruncation
import areallylongpackageandmodulenametotestreprtruncation
-eq(repr(areallylongpackageandmodulenametotestreprtruncation),
- module '%s' from '%s' %
(areallylongpackageandmodulenametotestreprtruncation.__name__,
areallylongpackageandmodulenametotestreprtruncation.__file__))
+# On PyPy, we use %r to format the file name; on CPython it is done
+# with '%s'. It seems to me that %r is safer arigo.
+if '__pypy__' in sys.builtin_module_names:
+eq(repr(areallylongpackageandmodulenametotestreprtruncation),
+ module %r from %r %
(areallylongpackageandmodulenametotestreprtruncation.__name__,
areallylongpackageandmodulenametotestreprtruncation.__file__))
+else:
+eq(repr(areallylongpackageandmodulenametotestreprtruncation),
+ module '%s' from '%s' %
(areallylongpackageandmodulenametotestreprtruncation.__name__,
areallylongpackageandmodulenametotestreprtruncation.__file__))
eq(repr(sys), module 'sys' (built-in))
def test_type(self):
diff --git a/lib-python/2.7/test/test_subprocess.py
b/lib-python/modified-2.7/test/test_subprocess.py
copy from lib-python/2.7/test/test_subprocess.py
copy to lib-python/modified-2.7/test/test_subprocess.py
--- a/lib-python/2.7/test/test_subprocess.py
+++ b/lib-python/modified-2.7/test/test_subprocess.py
@@ -16,11 +16,11 @@
# Depends on the following external programs: Python
#
-if mswindows:
-SETBINARY = ('import msvcrt; msvcrt.setmode(sys.stdout.fileno(), '
-'os.O_BINARY);')
-else:
-SETBINARY = ''
+#if mswindows:
+#SETBINARY = ('import msvcrt; msvcrt.setmode(sys.stdout.fileno(), '
+#'os.O_BINARY);')
+#else:
+#SETBINARY = ''
try:
@@ -420,8 +420,9 @@
self.assertStderrEqual(stderr, )
def test_universal_newlines(self):
-p = subprocess.Popen([sys.executable, -c,
- 'import sys,os;' + SETBINARY +
+# NB. replaced SETBINARY with the -u flag
+p = subprocess.Popen([sys.executable, -u, -c,
+ 'import sys,os;' + #SETBINARY +
'sys.stdout.write(line1\\n);'
'sys.stdout.flush();'
'sys.stdout.write(line2\\r);'
@@ -448,8 +449,9 @@
def test_universal_newlines_communicate(self):
# universal newlines through communicate()
-p = subprocess.Popen([sys.executable, -c,
- 'import sys,os;' + SETBINARY +
+# NB. replaced SETBINARY with the -u flag
+p = subprocess.Popen([sys.executable, -u, -c,
+ 'import sys,os;' + #SETBINARY +
'sys.stdout.write(line1\\n);'
'sys.stdout.flush();'
'sys.stdout.write(line2\\r);'
diff --git a/pypy/interpreter/test/test_executioncontext.py
b/pypy/interpreter/test/test_executioncontext.py
--- a/pypy/interpreter/test/test_executioncontext.py
+++ b/pypy/interpreter/test/test_executioncontext.py
@@ -292,7 +292,7 @@
import os, sys
print sys.executable, self.tmpfile
if sys.platform == win32:
-cmdformat = '%s %s'# excellent! tons of !
+cmdformat = '%s %s'
else:
cmdformat = '%s' '%s'
g = os.popen(cmdformat % (sys.executable, self.tmpfile), 'r')
diff --git a/pypy/jit/codewriter/call.py b/pypy/jit/codewriter/call.py
--- a/pypy/jit/codewriter/call.py
+++ b/pypy/jit/codewriter/call.py
@@ -212,7 +212,10 @@
elidable = False
loopinvariant = False
if op.opname == direct_call:
-func = getattr(get_funcobj(op.args[0].value),