[pypy-commit] pypy ffistruct: hg merge default

antocuni noreply at buildbot.pypy.org
Wed Nov 9 19:12:02 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ffistruct
Changeset: r49034:06d63733756d
Date: 2011-11-09 17:43 +0100
http://bitbucket.org/pypy/pypy/changeset/06d63733756d/

Log:	hg merge default

diff --git a/lib-python/2.7/test/test_os.py b/lib-python/2.7/test/test_os.py
--- a/lib-python/2.7/test/test_os.py
+++ b/lib-python/2.7/test/test_os.py
@@ -74,7 +74,8 @@
         self.assertFalse(os.path.exists(name),
                     "file already exists for temporary file")
         # make sure we can create the file
-        open(name, "w")
+        f = open(name, "w")
+        f.close()
         self.files.append(name)
 
     def test_tempnam(self):
diff --git a/pypy/rlib/rgc.py b/pypy/rlib/rgc.py
--- a/pypy/rlib/rgc.py
+++ b/pypy/rlib/rgc.py
@@ -216,8 +216,8 @@
     func._gc_no_collect_ = True
     return func
 
-def is_light_finalizer(func):
-    func._is_light_finalizer_ = True
+def must_be_light_finalizer(func):
+    func._must_be_light_finalizer_ = True
     return func
 
 # ____________________________________________________________
diff --git a/pypy/translator/backendopt/finalizer.py b/pypy/translator/backendopt/finalizer.py
--- a/pypy/translator/backendopt/finalizer.py
+++ b/pypy/translator/backendopt/finalizer.py
@@ -4,7 +4,7 @@
 
 class FinalizerError(Exception):
     """ __del__ marked as lightweight finalizer, but the analyzer did
-    not agreed
+    not agree
     """
 
 class FinalizerAnalyzer(graphanalyze.BoolGraphAnalyzer):
@@ -23,7 +23,7 @@
     def analyze_light_finalizer(self, graph):
         result = self.analyze_direct_call(graph)
         if (result is self.top_result() and
-            getattr(graph.func, '_is_light_finalizer_', False)):
+            getattr(graph.func, '_must_be_light_finalizer_', False)):
             raise FinalizerError(FinalizerError.__doc__, graph)
         return result
     
diff --git a/pypy/translator/backendopt/test/test_finalizer.py b/pypy/translator/backendopt/test/test_finalizer.py
--- a/pypy/translator/backendopt/test/test_finalizer.py
+++ b/pypy/translator/backendopt/test/test_finalizer.py
@@ -126,13 +126,13 @@
         r = self.analyze(f, [], A.__del__.im_func)
         assert r
 
-    def test_is_light_finalizer_decorator(self):
+    def test_must_be_light_finalizer_decorator(self):
         S = lltype.GcStruct('S')
 
-        @rgc.is_light_finalizer
+        @rgc.must_be_light_finalizer
         def f():
             lltype.malloc(S)
-        @rgc.is_light_finalizer
+        @rgc.must_be_light_finalizer
         def g():
             pass
         self.analyze(g, []) # did not explode


More information about the pypy-commit mailing list