[pypy-commit] pypy kill-single-impl-multimethods: random fixes for the tests (no idea why this matters)

alex_gaynor noreply at buildbot.pypy.org
Sun Aug 7 00:50:57 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: kill-single-impl-multimethods
Changeset: r46338:9adbac47e509
Date: 2011-08-06 15:52 -0700
http://bitbucket.org/pypy/pypy/changeset/9adbac47e509/

Log:	random fixes for the tests (no idea why this matters)

diff --git a/pypy/objspace/std/fake.py b/pypy/objspace/std/fake.py
--- a/pypy/objspace/std/fake.py
+++ b/pypy/objspace/std/fake.py
@@ -176,7 +176,7 @@
         assert isinstance(code, CPythonFakeCode)
         fn = code.cpy_callable
         try:
-            result = apply(fn, self.unwrappedargs, self.unwrappedkwds)
+            result = fn(*self.unwrappedargs, **self.unwrappedkwds)
         except:
             wrap_exception(self.space)
             raise
diff --git a/pypy/objspace/std/test/test_complexobject.py b/pypy/objspace/std/test/test_complexobject.py
--- a/pypy/objspace/std/test/test_complexobject.py
+++ b/pypy/objspace/std/test/test_complexobject.py
@@ -406,9 +406,10 @@
         b = 5.1+2.3j
 
         fo = None
+        pth = None
         try:
             pth = tempfile.mktemp()
-            fo = open(pth,"wb")
+            fo = open(pth, "wb")
             print >>fo, a, b
             fo.close()
             fo = open(pth, "rb")
@@ -417,10 +418,11 @@
         finally:
             if (fo is not None) and (not fo.closed):
                 fo.close()
-            try:
-                os.remove(pth)
-            except (OSError, IOError):
-                pass
+            if pth is not None:
+                try:
+                    os.remove(pth)
+                except (OSError, IOError):
+                    pass
 
     def test_convert(self):
         raises(TypeError, int, 1+1j)


More information about the pypy-commit mailing list