Author: Ronan Lamy <[email protected]>
Branch: py3.6
Changeset: r95166:0766e29baf22
Date: 2018-09-25 16:24 +0000
http://bitbucket.org/pypy/pypy/changeset/0766e29baf22/

Log:    Merged in davidcellis/pypy/py3.6 (pull request #629)

        Fix failing test in test_float

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
@@ -219,16 +219,16 @@
         w_value = w_x     # 'x' is the keyword argument name in CPython
         if space.lookup(w_value, "__float__") is not None:
             w_obj = space.float(w_value)
-            if space.is_w(w_floattype, space.w_float):
-                w_obj_type = space.type(w_obj)
-                if not space.is_w(w_obj_type, space.w_float):
-                    space.warn(space.newtext(
-                        "%s.__float__ returned non-float (type %s).  "
-                        "The ability to return an instance of a strict 
subclass "
-                        "of float is deprecated, and may be removed "
-                        "in a future version of Python." %
-                            (space.type(w_value).name, w_obj_type.name)),
-                        space.w_DeprecationWarning)
+            w_obj_type = space.type(w_obj)
+            if not space.is_w(w_obj_type, space.w_float):
+                space.warn(space.newtext(
+                    "%s.__float__ returned non-float (type %s).  "
+                    "The ability to return an instance of a strict subclass "
+                    "of float is deprecated, and may be removed "
+                    "in a future version of Python." %
+                    (space.type(w_value).name, w_obj_type.name)),
+                    space.w_DeprecationWarning)
+            elif space.is_w(w_floattype, space.w_float):
                 return w_obj
             value = space.float_w(w_obj)
         elif space.isinstance_w(w_value, space.w_unicode):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to