[pypy-commit] pypy default: don't use w_None here, it breaks cpyext

cfbolz noreply at buildbot.pypy.org
Thu Nov 24 13:50:27 CET 2011


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r49722:bedfacfcd12f
Date: 2011-11-24 13:48 +0100
http://bitbucket.org/pypy/pypy/changeset/bedfacfcd12f/

Log:	don't use w_None here, it breaks cpyext

diff --git a/pypy/module/_weakref/interp__weakref.py b/pypy/module/_weakref/interp__weakref.py
--- a/pypy/module/_weakref/interp__weakref.py
+++ b/pypy/module/_weakref/interp__weakref.py
@@ -1,7 +1,7 @@
 import py
 from pypy.interpreter.baseobjspace import Wrappable, W_Root
 from pypy.interpreter.error import OperationError
-from pypy.interpreter.gateway import interp2app, ObjSpace
+from pypy.interpreter.gateway import interp2app, ObjSpace, NoneNotWrapped
 from pypy.interpreter.typedef import TypeDef
 from pypy.rlib import jit
 import weakref
@@ -294,11 +294,11 @@
     lifeline = getlifelinewithcallbacks(space, w_obj)
     return lifeline.make_proxy_with_callback(w_obj, w_callable)
 
-def proxy(space, w_obj, w_callable=None):
+def proxy(space, w_obj, w_callable=NoneNotWrapped):
     """Create a proxy object that weakly references 'obj'.
 'callback', if given, is called with the proxy as an argument when 'obj'
 is about to be finalized."""
-    if space.is_w(w_callable, space.w_None):
+    if w_callable is None:
         return get_or_make_proxy(space, w_obj)
     else:
         return make_proxy_with_callback(space, w_obj, w_callable)


More information about the pypy-commit mailing list