[pypy-commit] pypy default: remove two wraps and a str_w

cfbolz pypy.commits at gmail.com
Sun Feb 19 15:50:49 EST 2017


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r90214:408b2ec34a3f
Date: 2017-02-19 21:49 +0100
http://bitbucket.org/pypy/pypy/changeset/408b2ec34a3f/

Log:	remove two wraps and a str_w

diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py
--- a/pypy/interpreter/astcompiler/astbuilder.py
+++ b/pypy/interpreter/astcompiler/astbuilder.py
@@ -1105,7 +1105,7 @@
                     raise
                 # UnicodeError in literal: turn into SyntaxError
                 e.normalize_exception(space)
-                errmsg = space.str_w(space.str(e.get_w_value(space)))
+                errmsg = space.text_w(space.str(e.get_w_value(space)))
                 raise self.error('(unicode error) %s' % errmsg, atom_node)
             # This implements implicit string concatenation.
             if len(sub_strings_w) > 1:
diff --git a/pypy/module/cpyext/userslot.py b/pypy/module/cpyext/userslot.py
--- a/pypy/module/cpyext/userslot.py
+++ b/pypy/module/cpyext/userslot.py
@@ -26,7 +26,7 @@
 
 @slot_function([PyObject, Py_ssize_t], PyObject)
 def slot_sq_item(space, w_obj, index):
-    return space.getitem(w_obj, space.wrap(index))
+    return space.getitem(w_obj, space.newint(index))
 
 @slot_function([PyTypeObjectPtr, PyObject, PyObject], PyObject)
 def slot_tp_new(space, w_type, w_args, w_kwds):
@@ -39,12 +39,12 @@
     #     we know (since we are in this function) that self is not a cpytype
     from pypy.module.cpyext.typeobject import W_PyCTypeObject
     w_type0 = w_type
-    mro_w = space.listview(space.getattr(w_type0, space.wrap('__mro__')))
+    mro_w = space.listview(space.getattr(w_type0, space.newtext('__mro__')))
     for w_m in mro_w[1:]:
         if not w_type0.is_cpytype():
             break
         w_type0 = w_m
-    w_impl = space.getattr(w_type0, space.wrap('__new__'))
+    w_impl = space.getattr(w_type0, space.newtext('__new__'))
     args = Arguments(space, [w_type],
                      w_stararg=w_args, w_starstararg=w_kwds)
     return space.call_args(w_impl, args)


More information about the pypy-commit mailing list