Author: Armin Rigo <[email protected]>
Branch: py3.5-newtext
Changeset: r90133:d09311567d06
Date: 2017-02-15 08:13 +0100
http://bitbucket.org/pypy/pypy/changeset/d09311567d06/
Log: hg merge 6673bc3db17b
diff --git a/pypy/module/_io/interp_textio.py b/pypy/module/_io/interp_textio.py
--- a/pypy/module/_io/interp_textio.py
+++ b/pypy/module/_io/interp_textio.py
@@ -941,7 +941,7 @@
space.bytes_w(w_chunk))
w_decoded = space.call_method(self.w_decoder, "decode",
- w_chunk,
space.newbool(cookie.need_eof))
+ w_chunk,
space.newbool(bool(cookie.need_eof)))
check_decoded(space, w_decoded)
self._set_decoded_chars(space.unicode_w(w_decoded))
diff --git a/pypy/module/_pypyjson/interp_encoder.py
b/pypy/module/_pypyjson/interp_encoder.py
--- a/pypy/module/_pypyjson/interp_encoder.py
+++ b/pypy/module/_pypyjson/interp_encoder.py
@@ -79,4 +79,4 @@
sb.append(HEX[s2 & 0x0f])
res = sb.build()
- return space.wrap(res)
+ return space.newtext(res)
diff --git a/pypy/module/_rawffi/alt/interp_funcptr.py
b/pypy/module/_rawffi/alt/interp_funcptr.py
--- a/pypy/module/_rawffi/alt/interp_funcptr.py
+++ b/pypy/module/_rawffi/alt/interp_funcptr.py
@@ -342,7 +342,7 @@
return space.newint(address_as_uint)
def getidentifier(self, space):
- return space.wrap(self.cdll.getidentifier())
+ return space.newint(self.cdll.getidentifier())
@unwrap_spec(name='str_or_None', mode=int)
def descr_new_cdll(space, w_type, name, mode=-1):
diff --git a/pypy/module/select/interp_select.py
b/pypy/module/select/interp_select.py
--- a/pypy/module/select/interp_select.py
+++ b/pypy/module/select/interp_select.py
@@ -91,7 +91,7 @@
retval_w = []
for fd, revents in retval:
retval_w.append(space.newtuple([space.newint(fd),
- space.newtext(revents)]))
+ space.newint(revents)]))
return space.newlist(retval_w)
pollmethods = {}
diff --git a/pypy/module/token/__init__.py b/pypy/module/token/__init__.py
--- a/pypy/module/token/__init__.py
+++ b/pypy/module/token/__init__.py
@@ -7,7 +7,7 @@
appleveldefs = {}
interpleveldefs = {
- "NT_OFFSET" : "space.wrap(256)",
+ "NT_OFFSET" : "space.newint(256)",
"ISTERMINAL" : "__init__.isterminal",
"ISNONTERMINAL" : "__init__.isnonterminal",
"ISEOF" : "__init__.iseof"
@@ -34,12 +34,12 @@
@unwrap_spec(tok=int)
def isterminal(space, tok):
- return space.wrap(tok < 256)
+ return space.newbool(tok < 256)
@unwrap_spec(tok=int)
def isnonterminal(space, tok):
- return space.wrap(tok >= 256)
+ return space.newbool(tok >= 256)
@unwrap_spec(tok=int)
def iseof(space, tok):
- return space.wrap(tok == pygram.tokens.ENDMARKER)
+ return space.newbool(tok == pygram.tokens.ENDMARKER)
diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -1980,6 +1980,7 @@
_none_value = None
def wrap(self, stringval):
+ assert stringval is not None
return self.space.newunicode(stringval)
def unwrap(self, w_string):
diff --git a/pypy/objspace/std/objspace.py b/pypy/objspace/std/objspace.py
--- a/pypy/objspace/std/objspace.py
+++ b/pypy/objspace/std/objspace.py
@@ -376,6 +376,7 @@
return self.newtext(s)
def newunicode(self, uni):
+ assert uni is not None
assert isinstance(uni, unicode)
return W_UnicodeObject(uni)
diff --git a/pypy/objspace/std/transparent.py b/pypy/objspace/std/transparent.py
--- a/pypy/objspace/std/transparent.py
+++ b/pypy/objspace/std/transparent.py
@@ -39,9 +39,9 @@
def setup(space):
"""Add proxy functions to the __pypy__ module."""
w___pypy__ = space.getbuiltinmodule("__pypy__")
- space.setattr(w___pypy__, space.newtext('tproxy'), space.wrap(app_proxy))
+ space.setattr(w___pypy__, space.newtext('tproxy'),
app_proxy.spacebind(space))
space.setattr(w___pypy__, space.newtext('get_tproxy_controller'),
- space.wrap(app_proxy_controller))
+ app_proxy_controller.spacebind(space))
def proxy(space, w_type, w_controller):
diff --git a/pypy/objspace/std/unicodeobject.py
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -1,7 +1,8 @@
"""The builtin str implementation"""
from rpython.rlib.objectmodel import (
- compute_hash, compute_unique_id, import_from_mixin)
+ compute_hash, compute_unique_id, import_from_mixin,
+ enforceargs)
from rpython.rlib.buffer import StringBuffer
from rpython.rlib.rstring import StringBuilder, UnicodeBuilder
from rpython.rlib.runicode import (
@@ -30,6 +31,7 @@
import_from_mixin(StringMethods)
_immutable_fields_ = ['_value']
+ @enforceargs(uni=unicode)
def __init__(self, unistr):
assert isinstance(unistr, unicode)
self._value = unistr
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit