Raise MemoryError instead of InvalidOperation/MallocError for compatibility

with decimal.py. The standard specifies InsufficientStorage (MallocError) as
a sub-condition of InvalidOperation. This allows a calculation to continue
with NaN results when allocation fails.
This commit is contained in:
Stefan Krah 2012-03-25 18:59:21 +02:00
parent 1d5617958f
commit fe17b2bc77
2 changed files with 9 additions and 2 deletions

View file

@ -3837,7 +3837,7 @@ class CheckAttributes(unittest.TestCase):
x = dir(C)
y = [s for s in dir(P) if '__' in s or not s.startswith('_')]
self.assertEqual(set(x) - set(y), {'MallocError'})
self.assertEqual(set(x) - set(y), set())
def test_context_attributes(self):