[pypy-commit] pypy default: Bah, the printed message was bogus because "name" is redefined in the outer loop

arigo pypy.commits at gmail.com
Mon Jul 1 05:56:20 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r96887:886d3fec1ad3
Date: 2019-07-01 11:53 +0200
http://bitbucket.org/pypy/pypy/changeset/886d3fec1ad3/

Log:	Bah, the printed message was bogus because "name" is redefined in
	the outer loop

diff --git a/pypy/module/cpyext/slotdefs.py b/pypy/module/cpyext/slotdefs.py
--- a/pypy/module/cpyext/slotdefs.py
+++ b/pypy/module/cpyext/slotdefs.py
@@ -861,8 +861,7 @@
         return 0
     return buff_w
 
-missing_wrappers = ['wrap_indexargfunc', 'wrap_delslice', 'wrap_coercefunc']
-for name in missing_wrappers:
+def _make_missing_wrapper(name):
     assert name not in globals()
     class missing_wrapper(W_PyCWrapperObject):
         def call(self, space, w_self, __args__):
@@ -871,6 +870,10 @@
     missing_wrapper.__name__ = name
     globals()[name] = missing_wrapper
 
+missing_wrappers = ['wrap_indexargfunc', 'wrap_delslice', 'wrap_coercefunc']
+for name in missing_wrappers:
+    _make_missing_wrapper(name)
+
 def make_missing_slot(space, typedef, name, attr):
     return None
 


More information about the pypy-commit mailing list