[pypy-commit] pypy py3.7-bpo-29839: Fix translation by avoiding space.unwrap

Yannick_Jadoul pypy.commits at gmail.com
Sun Oct 20 02:39:54 EDT 2019


Author: Yannick Jadoul <yannick.jadoul at belgacom.net>
Branch: py3.7-bpo-29839
Changeset: r97821:25e4f3f9050d
Date: 2019-10-19 20:29 +0200
http://bitbucket.org/pypy/pypy/changeset/25e4f3f9050d/

Log:	Fix translation by avoiding space.unwrap

diff --git a/pypy/objspace/descroperation.py b/pypy/objspace/descroperation.py
--- a/pypy/objspace/descroperation.py
+++ b/pypy/objspace/descroperation.py
@@ -269,7 +269,7 @@
         # Will complain if result is too big.
         w_result = space.index(w_obj)
         assert space.isinstance_w(w_result, space.w_int)
-        if space.unwrap(w_result) < 0:
+        if space.is_true(space.lt(w_result, space.newint(0))):
             raise oefmt(space.w_ValueError, "__len__() should return >= 0")
         result = space.getindex_w(w_result, space.w_OverflowError)
         assert result >= 0


More information about the pypy-commit mailing list