summaryrefslogtreecommitdiff
path: root/numpy/core/_exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/_exceptions.py')
-rw-r--r--numpy/core/_exceptions.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/numpy/core/_exceptions.py b/numpy/core/_exceptions.py
index a1997ef6b..1dcea6255 100644
--- a/numpy/core/_exceptions.py
+++ b/numpy/core/_exceptions.py
@@ -121,3 +121,15 @@ class AxisError(ValueError, IndexError):
msg = "{}: {}".format(msg_prefix, msg)
super(AxisError, self).__init__(msg)
+
+
+@_display_as_base
+class _ArrayMemoryError(MemoryError):
+ """ Thrown when an array cannot be allocated"""
+ def __init__(self, shape, dtype):
+ self.shape = shape
+ self.dtype = dtype
+
+ def __str__(self):
+ return "Unable to allocate array with shape {} and data type {}".format(self.shape, self.dtype)
+