[pypy-commit] pypy remove-remaining-smm: Use space.float_w here.

Manuel Jacob noreply at buildbot.pypy.org
Mon Feb 24 21:56:11 CET 2014


Author: Manuel Jacob
Branch: remove-remaining-smm
Changeset: r69370:9b9f11802928
Date: 2014-02-24 21:49 +0100
http://bitbucket.org/pypy/pypy/changeset/9b9f11802928/

Log:	Use space.float_w here.

diff --git a/pypy/objspace/std/floatobject.py b/pypy/objspace/std/floatobject.py
--- a/pypy/objspace/std/floatobject.py
+++ b/pypy/objspace/std/floatobject.py
@@ -352,9 +352,9 @@
         if isinstance(w_obj, W_FloatObject):
             return w_obj
         if space.isinstance_w(w_obj, space.w_int):
-            return W_FloatObject(float(space.int_w(w_obj)))
+            return W_FloatObject(space.float_w(w_obj))
         if space.isinstance_w(w_obj, space.w_long):
-            return W_FloatObject(w_obj.tofloat(space))
+            return W_FloatObject(space.float_w(w_obj))
 
     def _float2string(self, x, code, precision):
         # we special-case explicitly inf and nan here


More information about the pypy-commit mailing list