From a617e208fc9fcb8022f429bca20818c472ad9a4e Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 25 Jan 2010 03:52:52 +0000 Subject: mention from_float() in error message --- Lib/decimal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/decimal.py b/Lib/decimal.py index 4caa4ce..51b87d9 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -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) -- cgit v0.12