summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/decimal.py2
-rw-r--r--Lib/test/test_decimal.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index b78c2c5..5a9f840 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 ValueError('Cannot hash a signaling NaN value.')
+ raise TypeError('Cannot hash a signaling NaN value.')
elif self.is_nan():
return _PyHASH_NAN
else:
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index b07fb1d..611ef55 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -1346,7 +1346,7 @@ class DecimalUsabilityTest(unittest.TestCase):
#the same hash that to an int
self.assertEqual(hashit(Decimal(23)), hashit(23))
- self.assertRaises(ValueError, hash, Decimal('sNaN'))
+ self.assertRaises(TypeError, hash, Decimal('sNaN'))
self.assertTrue(hashit(Decimal('Inf')))
self.assertTrue(hashit(Decimal('-Inf')))