Author: Manuel Jacob <[email protected]>
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):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to