summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-15 20:43:51 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-15 20:43:51 (GMT)
commit2be161dcfa531b0e2f3f9887e198be59f477854e (patch)
tree6d3c4ff73a1b7aad99c5d15ec00f77d71f744cfb /Lib/test/test_float.py
parenta28c291e92d30c64fdc034f3714be0d9158af225 (diff)
downloadcpython-2be161dcfa531b0e2f3f9887e198be59f477854e.zip
cpython-2be161dcfa531b0e2f3f9887e198be59f477854e.tar.gz
cpython-2be161dcfa531b0e2f3f9887e198be59f477854e.tar.bz2
Make tset_float pass. float(<unicode>) was never very good -- it used
a fixed-length buffer of 256 bytes.
Diffstat (limited to 'Lib/test/test_float.py')
-rw-r--r--Lib/test/test_float.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_float.py b/Lib/test/test_float.py
index fb47db8..4f4cffd 100644
--- a/Lib/test/test_float.py
+++ b/Lib/test/test_float.py
@@ -39,15 +39,15 @@ class FormatFunctionsTestCase(unittest.TestCase):
self.assertRaises(ValueError, float.__setformat__,
'chicken', 'unknown')
-BE_DOUBLE_INF = '\x7f\xf0\x00\x00\x00\x00\x00\x00'
-LE_DOUBLE_INF = ''.join(reversed(BE_DOUBLE_INF))
-BE_DOUBLE_NAN = '\x7f\xf8\x00\x00\x00\x00\x00\x00'
-LE_DOUBLE_NAN = ''.join(reversed(BE_DOUBLE_NAN))
-
-BE_FLOAT_INF = '\x7f\x80\x00\x00'
-LE_FLOAT_INF = ''.join(reversed(BE_FLOAT_INF))
-BE_FLOAT_NAN = '\x7f\xc0\x00\x00'
-LE_FLOAT_NAN = ''.join(reversed(BE_FLOAT_NAN))
+BE_DOUBLE_INF = b'\x7f\xf0\x00\x00\x00\x00\x00\x00'
+LE_DOUBLE_INF = bytes(reversed(BE_DOUBLE_INF))
+BE_DOUBLE_NAN = b'\x7f\xf8\x00\x00\x00\x00\x00\x00'
+LE_DOUBLE_NAN = bytes(reversed(BE_DOUBLE_NAN))
+
+BE_FLOAT_INF = b'\x7f\x80\x00\x00'
+LE_FLOAT_INF = bytes(reversed(BE_FLOAT_INF))
+BE_FLOAT_NAN = b'\x7f\xc0\x00\x00'
+LE_FLOAT_NAN = bytes(reversed(BE_FLOAT_NAN))
# on non-IEEE platforms, attempting to unpack a bit pattern
# representing an infinity or a NaN should raise an exception.