Author: Armin Rigo <>
Branch: py3k
Changeset: r87332:e00dbe634410
Date: 2016-09-22 18:11 +0200

Log:    Functions and methods that are actually "built-in" on CPython might
        end up with FunctionType or MethodType. We need to work harder to be
        sure to exclude them here.

diff --git a/lib-python/3/idlelib/ b/lib-python/3/idlelib/
--- a/lib-python/3/idlelib/
+++ b/lib-python/3/idlelib/
@@ -144,7 +144,8 @@
         fob = ob_call
         fob = ob
-    if isinstance(fob, (types.FunctionType, types.MethodType)):
+    if (isinstance(fob, (types.FunctionType, types.MethodType)) and
+            hasattr(fob.__code__, 'co_code')):  # PyPy: not on <builtin-code>
         argspec = inspect.formatargspec(*inspect.getfullargspec(fob))
         if (isinstance(ob, (type, types.MethodType)) or
                 isinstance(ob_call, types.MethodType)):
pypy-commit mailing list

Reply via email to