[pypy-commit] pypy default: hg merge heads

amauryfa noreply at buildbot.pypy.org
Mon Nov 5 21:34:26 CET 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: 
Changeset: r58750:46d142d32515
Date: 2012-11-05 21:33 +0100
http://bitbucket.org/pypy/pypy/changeset/46d142d32515/

Log:	hg merge heads

diff --git a/pypy/objspace/std/bytearrayobject.py b/pypy/objspace/std/bytearrayobject.py
--- a/pypy/objspace/std/bytearrayobject.py
+++ b/pypy/objspace/std/bytearrayobject.py
@@ -83,14 +83,6 @@
     data = makebytearraydata_w(space, w_source)
     w_bytearray.data = data
 
-def float__Bytearray(space, w_bytearray):
-    try:
-        value = string_to_float(''.join(w_bytearray.data))
-    except ParseStringError, e:
-        raise OperationError(space.w_ValueError, space.wrap(e.msg))
-    else:
-        return space.wrap(value)
-
 def len__Bytearray(space, w_bytearray):
     result = len(w_bytearray.data)
     return wrapint(space, result)
diff --git a/pypy/objspace/std/floattype.py b/pypy/objspace/std/floattype.py
--- a/pypy/objspace/std/floattype.py
+++ b/pypy/objspace/std/floattype.py
@@ -35,8 +35,9 @@
         if 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_str):
-        strvalue = space.str_w(w_value)
+    elif (space.isinstance_w(w_value, space.w_str) or
+          space.isinstance_w(w_value, space.w_bytearray)):
+        strvalue = space.bufferstr_w(w_value)
         try:
             value = string_to_float(strvalue)
         except ParseStringError, e:


More information about the pypy-commit mailing list