[pypy-commit] pypy default: Cleanup get_graph() function.

mjacob pypy.commits at gmail.com
Tue Jan 12 18:39:34 EST 2016


Author: Manuel Jacob <me at manueljacob.de>
Branch: 
Changeset: r81691:419c89606228
Date: 2016-01-13 00:31 +0100
http://bitbucket.org/pypy/pypy/changeset/419c89606228/

Log:	Cleanup get_graph() function.

	1) Remove last try block, which was dead. 2) Remove getting
	funcobj._callable. The `callable` variable was unused after 1).

	In case you wonder whether there might have been a bug before: AFAIK
	translator._graphof(funcobj._callable) can't return something if
	funcobj.graph is not present.

diff --git a/rpython/translator/simplify.py b/rpython/translator/simplify.py
--- a/rpython/translator/simplify.py
+++ b/rpython/translator/simplify.py
@@ -24,22 +24,13 @@
     if not isinstance(f, lltype._ptr):
         return None
     try:
-        funcobj = f._getobj()
+        funcobj = f._obj
     except lltype.DelayedPointer:
         return None
     try:
-        callable = funcobj._callable
-    except (AttributeError, KeyError, AssertionError):
-        return None
-    try:
         return funcobj.graph
     except AttributeError:
         return None
-    try:
-        callable = funcobj._callable
-        return translator._graphof(callable)
-    except (AttributeError, KeyError, AssertionError):
-        return None
 
 
 def replace_exitswitch_by_constant(block, const):


More information about the pypy-commit mailing list