Author: Carl Friedrich Bolz <cfb...@gmx.de> Branch: space-newtext Changeset: r88079:22c094827f52 Date: 2016-11-02 14:08 +0100 http://bitbucket.org/pypy/pypy/changeset/22c094827f52/
Log: gc, imp diff --git a/pypy/module/gc/referents.py b/pypy/module/gc/referents.py --- a/pypy/module/gc/referents.py +++ b/pypy/module/gc/referents.py @@ -30,7 +30,7 @@ def wrap(space, gcref): w_obj = try_cast_gcref_to_w_root(gcref) if w_obj is None: - w_obj = space.wrap(W_GcRef(gcref)) + w_obj = W_GcRef(gcref) return w_obj def unwrap(space, w_obj): @@ -149,7 +149,7 @@ size = rgc.get_rpy_memory_usage(gcref) if size < 0: raise missing_operation(space) - return space.wrap(size) + return space.newint(size) def get_rpy_type_index(space, w_obj): """Return an integer identifying the RPython type of the given @@ -159,7 +159,7 @@ index = rgc.get_rpy_type_index(gcref) if index < 0: raise missing_operation(space) - return space.wrap(index) + return space.newint(index) def get_objects(space): """Return a list of all app-level objects.""" @@ -202,9 +202,9 @@ def get_typeids_z(space): a = rgc.get_typeids_z() s = ''.join([a[i] for i in range(len(a))]) - return space.wrap(s) + return space.newtext(s) def get_typeids_list(space): l = rgc.get_typeids_list() - list_w = [space.wrap(l[i]) for i in range(len(l))] + list_w = [space.newint(l[i]) for i in range(len(l))] return space.newlist(list_w) diff --git a/pypy/module/imp/interp_imp.py b/pypy/module/imp/interp_imp.py --- a/pypy/module/imp/interp_imp.py +++ b/pypy/module/imp/interp_imp.py @@ -9,15 +9,19 @@ def get_suffixes(space): - w = space.wrap suffixes_w = [] if importing.has_so_extension(space): suffixes_w.append( - space.newtuple([w(importing.get_so_extension(space)), - w('rb'), w(importing.C_EXTENSION)])) + space.newtuple([space.newtext(importing.get_so_extension(space)), + space.newtext('rb'), + space.newtext(importing.C_EXTENSION)])) suffixes_w.extend([ - space.newtuple([w('.py'), w('U'), w(importing.PY_SOURCE)]), - space.newtuple([w('.pyc'), w('rb'), w(importing.PY_COMPILED)]), + space.newtuple([space.newtext('.py'), + space.newtext('U'), + space.newtext(importing.PY_SOURCE)]), + space.newtuple([space.newtext('.pyc'), + space.newtext('rb'), + space.newtext(importing.PY_COMPILED)]), ]) return space.newlist(suffixes_w) @@ -30,7 +34,7 @@ c = x & 0xff x >>= 8 d = x & 0xff - return space.wrap(chr(a) + chr(b) + chr(c) + chr(d)) + return space.newbytes(chr(a) + chr(b) + chr(c) + chr(d)) def get_file(space, w_file, filename, filemode): if space.is_none(w_file): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit