Author: Carl Friedrich Bolz <cfb...@gmx.de> Branch: space-newtext Changeset: r88073:8604f987eddd Date: 2016-11-02 13:08 +0100 http://bitbucket.org/pypy/pypy/changeset/8604f987eddd/
Log: select diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py --- a/pypy/interpreter/gateway.py +++ b/pypy/interpreter/gateway.py @@ -681,7 +681,7 @@ return self.sig def getdocstring(self, space): - return space.newtext(self.docstring) + return space.newtext_or_none(self.docstring) def funcrun(self, func, args): return BuiltinCode.funcrun_obj(self, func, None, args) diff --git a/pypy/module/select/interp_epoll.py b/pypy/module/select/interp_epoll.py --- a/pypy/module/select/interp_epoll.py +++ b/pypy/module/select/interp_epoll.py @@ -93,11 +93,11 @@ if epfd < 0: raise exception_from_saved_errno(space, space.w_IOError) - return space.wrap(W_Epoll(space, epfd)) + return W_Epoll(space, epfd) @unwrap_spec(fd=int) def descr_fromfd(space, w_cls, fd): - return space.wrap(W_Epoll(space, fd)) + return W_Epoll(space, fd) def _finalize_(self): self.close() @@ -127,11 +127,11 @@ raise exception_from_saved_errno(space, space.w_IOError) def descr_get_closed(self, space): - return space.wrap(self.get_closed()) + return space.newbool(self.get_closed()) def descr_fileno(self, space): self.check_closed(space) - return space.wrap(self.epfd) + return space.newint(self.epfd) def descr_close(self, space): self.close() @@ -173,7 +173,7 @@ for i in xrange(nfds): event = evs[i] elist_w[i] = space.newtuple( - [space.wrap(event.c_data.c_fd), space.wrap(event.c_events)] + [space.newint(event.c_data.c_fd), space.newint(event.c_events)] ) return space.newlist(elist_w) diff --git a/pypy/module/select/interp_kqueue.py b/pypy/module/select/interp_kqueue.py --- a/pypy/module/select/interp_kqueue.py +++ b/pypy/module/select/interp_kqueue.py @@ -115,11 +115,11 @@ kqfd = syscall_kqueue() if kqfd < 0: raise exception_from_saved_errno(space, space.w_IOError) - return space.wrap(W_Kqueue(space, kqfd)) + return W_Kqueue(space, kqfd) @unwrap_spec(fd=int) def descr_fromfd(space, w_cls, fd): - return space.wrap(W_Kqueue(space, fd)) + return W_Kqueue(space, fd) def _finalize_(self): self.close() @@ -139,11 +139,11 @@ "I/O operation on closed kqueue fd") def descr_get_closed(self, space): - return space.wrap(self.get_closed()) + return space.newbool(self.get_closed()) def descr_fileno(self, space): self.check_closed(space) - return space.wrap(self.kqfd) + return space.newint(self.kqfd) def descr_close(self, space): self.close() @@ -317,40 +317,40 @@ return self._compare_all_fields(space.interp_w(W_Kevent, other), op) def descr__eq__(self, space, w_other): - return space.wrap(self.compare_all_fields(space, w_other, "eq")) + return space.newbool(self.compare_all_fields(space, w_other, "eq")) def descr__ne__(self, space, w_other): - return space.wrap(not self.compare_all_fields(space, w_other, "eq")) + return space.newbool(not self.compare_all_fields(space, w_other, "eq")) def descr__le__(self, space, w_other): - return space.wrap(not self.compare_all_fields(space, w_other, "gt")) + return space.newbool(not self.compare_all_fields(space, w_other, "gt")) def descr__lt__(self, space, w_other): - return space.wrap(self.compare_all_fields(space, w_other, "lt")) + return space.newbool(self.compare_all_fields(space, w_other, "lt")) def descr__ge__(self, space, w_other): - return space.wrap(not self.compare_all_fields(space, w_other, "lt")) + return space.newbool(not self.compare_all_fields(space, w_other, "lt")) def descr__gt__(self, space, w_other): - return space.wrap(self.compare_all_fields(space, w_other, "gt")) + return space.newbool(self.compare_all_fields(space, w_other, "gt")) def descr_get_ident(self, space): - return space.wrap(self.ident) + return space.newint(self.ident) def descr_get_filter(self, space): - return space.wrap(self.filter) + return space.newint(self.filter) def descr_get_flags(self, space): - return space.wrap(self.flags) + return space.newint(self.flags) def descr_get_fflags(self, space): - return space.wrap(self.fflags) + return space.newint(self.fflags) def descr_get_data(self, space): - return space.wrap(self.data) + return space.newint(self.data) def descr_get_udata(self, space): - return space.wrap(rffi.cast(rffi.UINTPTR_T, self.udata)) + return space.newint(rffi.cast(rffi.UINTPTR_T, self.udata)) W_Kevent.typedef = TypeDef("select.kevent", 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 @@ -48,7 +48,7 @@ try: del self.fddict[fd] except KeyError: - raise OperationError(space.w_KeyError, space.wrap(fd)) + raise OperationError(space.w_KeyError, space.newint(fd)) @unwrap_spec(w_timeout=WrappedDefault(None)) def poll(self, space, w_timeout): @@ -74,15 +74,15 @@ w_errortype = space.fromcache(Cache).w_error message = e.get_msg() raise OperationError(w_errortype, - space.newtuple([space.wrap(e.errno), - space.wrap(message)])) + space.newtuple([space.newint(e.errno), + space.newtext(message)])) finally: self.running = False retval_w = [] for fd, revents in retval: - retval_w.append(space.newtuple([space.wrap(fd), - space.wrap(revents)])) + retval_w.append(space.newtuple([space.newint(fd), + space.newtext(revents)])) return space.newlist(retval_w) pollmethods = {} @@ -133,7 +133,7 @@ msg = _c.socket_strerror_str(errno) w_errortype = space.fromcache(Cache).w_error raise OperationError(w_errortype, space.newtuple([ - space.wrap(errno), space.wrap(msg)])) + space.newint(errno), space.newtext(msg)])) resin_w = [] resout_w = [] _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit