[pypy-commit] pypy py3k: oops, more func_code -> __code__ (thanks amaury)

pjenvey noreply at buildbot.pypy.org
Mon Jan 21 23:44:37 CET 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r60330:dfc05d1615c3
Date: 2013-01-21 14:33 -0800
http://bitbucket.org/pypy/pypy/changeset/dfc05d1615c3/

Log:	oops, more func_code -> __code__ (thanks amaury)

diff --git a/lib-python/3.2/inspect.py b/lib-python/3.2/inspect.py
--- a/lib-python/3.2/inspect.py
+++ b/lib-python/3.2/inspect.py
@@ -767,10 +767,10 @@
     and 'varkw' are the names of the * and ** arguments or None."""
 
     if not iscode(co):
-        if hasattr(len, '__code__') and type(co) is type(len.func_code):
-            # PyPy extension: built-in function objects have a func_code too.
-            # There is no co_code on it, but co_argcount and co_varnames and
-            # co_flags are present.
+        if hasattr(len, '__code__') and type(co) is type(len.__code__):
+            # PyPy extension: built-in function objects have a __code__
+            # too.  There is no co_code on it, but co_argcount and
+            # co_varnames and co_flags are present.
             pass
         else:
             raise TypeError('{!r} is not a code object'.format(co))


More information about the pypy-commit mailing list