Author: Ronan Lamy <[email protected]>
Branch: 
Changeset: r92528:a390ace21a3c
Date: 2017-10-01 16:08 +0200
http://bitbucket.org/pypy/pypy/changeset/a390ace21a3c/

Log:    Clean up update_all_slots() a bit

diff --git a/pypy/module/cpyext/typeobject.py b/pypy/module/cpyext/typeobject.py
--- a/pypy/module/cpyext/typeobject.py
+++ b/pypy/module/cpyext/typeobject.py
@@ -243,10 +243,10 @@
 
     for method_name, slot_name, slot_names, slot_apifunc in 
slotdefs_for_tp_slots:
         slot_func_helper = None
-        if search_dict_w is None:
+        if typedef is not None:
             # built-in types: expose as many slots as possible, even
             # if it happens to come from some parent class
-            slot_apifunc = None # use get_slot_tp_function
+            slot_apifunc = get_slot_tp_function(space, typedef, slot_name)
         else:
             # For heaptypes, w_type.layout.typedef will be object's typedef, 
and
             # get_slot_tp_function will fail
@@ -263,9 +263,6 @@
                     slot_func_helper = getattr(struct, slot_names[1])
 
         if not slot_func_helper:
-            if typedef is not None:
-                if slot_apifunc is None:
-                    slot_apifunc = get_slot_tp_function(space, typedef, 
slot_name)
             if not slot_apifunc:
                 if not we_are_translated():
                     if slot_name not in missing_slots:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to