Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r59496:1f72131c8e9a
Date: 2012-12-18 15:38 -0800
http://bitbucket.org/pypy/pypy/changeset/1f72131c8e9a/

Log:    use fixedview here

diff --git a/pypy/objspace/std/longtype.py b/pypy/objspace/std/longtype.py
--- a/pypy/objspace/std/longtype.py
+++ b/pypy/objspace/std/longtype.py
@@ -190,9 +190,9 @@
 
     # result = self - divmod_near(self, 10 ** -ndigits)[1]
     right = rbigint.fromint(10).pow(ndigits.neg())
-    w_temp = divmod_near(space, w_long, newlong(space, right))
-    w_temp2 = space.getitem(w_temp, space.wrap(1))
-    return space.sub(w_long, w_temp2)
+    w_tuple = divmod_near(space, w_long, newlong(space, right))
+    _, w_r = space.fixedview(w_tuple, 2)
+    return space.sub(w_long, w_r)
 
 # ____________________________________________________________
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to