]> granicus.if.org Git - python/commitdiff
When passed a bad formed literal to Decimal, now we have a
authorFacundo Batista <facundobatista@gmail.com>
Wed, 15 Aug 2007 15:13:09 +0000 (15:13 +0000)
committerFacundo Batista <facundobatista@gmail.com>
Wed, 15 Aug 2007 15:13:09 +0000 (15:13 +0000)
better error message, more descriptive. (bug #1770009)

Lib/decimal.py

index f65193524f22b00d9d35652e5a9f10f94dcd93fc..7c67895560a1dc4f65e259e3bc29dcf4adac33b6 100644 (file)
@@ -612,7 +612,8 @@ class Decimal(object):
             except ValueError:
                 self._is_special = True
                 self._sign, self._int, self._exp = \
-                                        context._raise_error(ConversionSyntax)
+                              context._raise_error(ConversionSyntax,
+                                  "Invalid literal for Decimal: %r" % value)
             return self
 
         raise TypeError("Cannot convert %r to Decimal" % value)