[pypy-commit] pypy translation-cleanup: Split off _init_graph() from FlowExecutionContext.__init__()

rlamy noreply at buildbot.pypy.org
Fri Aug 10 10:03:27 CEST 2012


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: translation-cleanup
Changeset: r56674:5a488bd039a3
Date: 2012-08-08 13:01 +0100
http://bitbucket.org/pypy/pypy/changeset/5a488bd039a3/

Log:	Split off _init_graph() from FlowExecutionContext.__init__()

diff --git a/pypy/objspace/flow/flowcontext.py b/pypy/objspace/flow/flowcontext.py
--- a/pypy/objspace/flow/flowcontext.py
+++ b/pypy/objspace/flow/flowcontext.py
@@ -211,7 +211,9 @@
         self.joinpoints = {}
         initialblock = SpamBlock(frame.getstate().copy())
         self.pendingblocks = collections.deque([initialblock])
+        self._init_graph(func, initialblock)
 
+    def _init_graph(self, func, initialblock):
         # CallableFactory.pycall may add class_ to functions that are methods
         name = func.func_name
         class_ = getattr(func, 'class_', None)
@@ -224,7 +226,7 @@
         # attach a signature and defaults to the graph
         # so that it becomes even more interchangeable with the function
         # itself
-        graph.signature = code.signature()
+        graph.signature = self.code.signature()
         graph.defaults = func.func_defaults or ()
 
     make_link = Link # overridable for transition tracking


More information about the pypy-commit mailing list