[pypy-commit] pypy py3k: fix translation
pjenvey
pypy.commits at gmail.com
Wed May 18 22:53:48 EDT 2016
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r84517:e824f622dcf4
Date: 2016-05-18 19:51 -0700
http://bitbucket.org/pypy/pypy/changeset/e824f622dcf4/
Log: fix translation
diff --git a/pypy/objspace/std/typeobject.py b/pypy/objspace/std/typeobject.py
--- a/pypy/objspace/std/typeobject.py
+++ b/pypy/objspace/std/typeobject.py
@@ -1041,7 +1041,8 @@
"__weakref__ slot disallowed: we already got one")
wantweakref = True
else:
- index_next_extra_slot = create_slot(w_self, slot_name,
+ index_next_extra_slot = create_slot(w_self, w_slot_name,
+ slot_name,
index_next_extra_slot)
wantdict = wantdict or hasoldstylebase
if wantdict:
@@ -1057,7 +1058,7 @@
return Layout(base_layout.typedef, index_next_extra_slot,
base_layout=base_layout)
-def create_slot(w_self, slot_name, index_next_extra_slot):
+def create_slot(w_self, w_slot_name, slot_name, index_next_extra_slot):
space = w_self.space
if not valid_slot_name(slot_name):
raise oefmt(space.w_TypeError, "__slots__ must be identifiers")
@@ -1065,8 +1066,8 @@
slot_name = mangle(slot_name, w_self.name)
if slot_name in w_self.dict_w:
raise oefmt(space.w_ValueError,
- "'%s' in __slots__ conflicts with class variable",
- slot_name.decode('utf-8'))
+ "%R in __slots__ conflicts with class variable",
+ w_slot_name)
else:
# Force interning of slot names.
slot_name = space.str_w(space.new_interned_str(slot_name))
More information about the pypy-commit
mailing list