summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorStefan Krah <stefan@bytereef.org>2010-11-18 15:20:34 (GMT)
committerStefan Krah <stefan@bytereef.org>2010-11-18 15:20:34 (GMT)
commitd8b661dd908629b5fc0f50e3e0c5fc5c85f9cb72 (patch)
treed0ef7aecae02539954c2a7a0411a4063d473cd2c /Lib/decimal.py
parentd28f790b69190192f7f8412f182b57c5894fade6 (diff)
downloadcpython-d8b661dd908629b5fc0f50e3e0c5fc5c85f9cb72.zip
cpython-d8b661dd908629b5fc0f50e3e0c5fc5c85f9cb72.tar.gz
cpython-d8b661dd908629b5fc0f50e3e0c5fc5c85f9cb72.tar.bz2
Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of TypeError.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 5a9f840..b78c2c5 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -943,7 +943,7 @@ class Decimal(object):
# in the documentation. (See library docs, 'Built-in Types').
if self._is_special:
if self.is_snan():
- raise TypeError('Cannot hash a signaling NaN value.')
+ raise ValueError('Cannot hash a signaling NaN value.')
elif self.is_nan():
return _PyHASH_NAN
else: