Commits

Alex Gaynor committed 9adbac4

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

  • Participants
  • Parent commits 216a263
  • Branches kill-single-impl-multimethods

Comments (0)

Files changed (2)

File pypy/objspace/std/fake.py

         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

File pypy/objspace/std/test/test_complexobject.py

         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")
         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)