[pypy-svn] r46685 - pypy/dist/pypy/tool

arigo at codespeak.net arigo at codespeak.net
Sun Sep 16 21:18:09 CEST 2007


Author: arigo
Date: Sun Sep 16 21:18:08 2007
New Revision: 46685

Modified:
   pypy/dist/pypy/tool/error.py
Log:
Don't crash if FunctionDesc.pyobj is None.


Modified: pypy/dist/pypy/tool/error.py
==============================================================================
--- pypy/dist/pypy/tool/error.py	(original)
+++ pypy/dist/pypy/tool/error.py	Sun Sep 16 21:18:08 2007
@@ -117,8 +117,12 @@
     descs = annotator.bindings[oper.args[0]].descriptions
     for desc in descs.keys():
         func = desc.pyobj
-        msg.append("  function %s <%s, line %s> returning" % (func.func_name,
-                   func.func_code.co_filename, func.func_code.co_firstlineno))
+        if func is None:
+            r = repr(desc)
+        else:
+            r = "function %s <%s, line %s>" % (func.func_name,
+                   func.func_code.co_filename, func.func_code.co_firstlineno)
+        msg.append("  %s returning" % (r,))
         graph = desc.getuniquegraph()
         msg.append("      %s" % annotator.binding(
             graph.returnblock.inputargs[0], "(no annotation)"))



More information about the Pypy-commit mailing list