]> granicus.if.org Git - python/commitdiff
mention from_float() in error message
authorBenjamin Peterson <benjamin@python.org>
Mon, 25 Jan 2010 03:52:52 +0000 (03:52 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 25 Jan 2010 03:52:52 +0000 (03:52 +0000)
Lib/decimal.py

index 4caa4cea79e64d92c9b02d9294c8185f390806b7..51b87d9ed6d98030b064780d0aa4f7bc0baa5d0a 100644 (file)
@@ -648,8 +648,8 @@ class Decimal(object):
             return self
 
         if isinstance(value, float):
-            raise TypeError("Cannot convert float to Decimal.  " +
-                            "First convert the float to a string")
+            raise TypeError("Cannot convert float in Decimal constructor. "
+                            "Use from_float class method.")
 
         raise TypeError("Cannot convert %r to Decimal" % value)