diff options
author | Facundo Batista <facundobatista@gmail.com> | 2007-08-15 15:13:09 (GMT) |
---|---|---|
committer | Facundo Batista <facundobatista@gmail.com> | 2007-08-15 15:13:09 (GMT) |
commit | 849693989ade7304d9a112b01315ed3779ecdb0c (patch) | |
tree | c0b7ac377d4a0ced75231207abf7994a4d304370 /Lib/decimal.py | |
parent | 8ec7f656134b1230ab23003a94ba3266d7064122 (diff) | |
download | cpython-849693989ade7304d9a112b01315ed3779ecdb0c.zip cpython-849693989ade7304d9a112b01315ed3779ecdb0c.tar.gz cpython-849693989ade7304d9a112b01315ed3779ecdb0c.tar.bz2 |
When passed a bad formed literal to Decimal, now we have a
better error message, more descriptive. (bug #1770009)
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index f651935..7c67895 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -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) |