summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorFacundo Batista <facundobatista@gmail.com>2007-08-15 15:13:09 (GMT)
committerFacundo Batista <facundobatista@gmail.com>2007-08-15 15:13:09 (GMT)
commit849693989ade7304d9a112b01315ed3779ecdb0c (patch)
treec0b7ac377d4a0ced75231207abf7994a4d304370 /Lib/decimal.py
parent8ec7f656134b1230ab23003a94ba3266d7064122 (diff)
downloadcpython-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.py3
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)