diff options
author | Mircea Akos Bruma <akos@debian-gnu-linux-vm.localdomain> | 2019-04-23 13:35:23 +0200 |
---|---|---|
committer | Mircea Akos Bruma <akos@debian-gnu-linux-vm.localdomain> | 2019-04-23 13:37:16 +0200 |
commit | 539fa48df6c8e1ed079d1ef374006f93c26384b4 (patch) | |
tree | 8a9e5e9b9f33ef74285a30ba989e4070826e80f0 /numpy/core/_exceptions.py | |
parent | df34770bde8ff4aa4834b9baf161e83beacfefb8 (diff) | |
download | numpy-539fa48df6c8e1ed079d1ef374006f93c26384b4.tar.gz |
ENH:improve memory error message by adding shape and data type(#13225)
Diffstat (limited to 'numpy/core/_exceptions.py')
-rw-r--r-- | numpy/core/_exceptions.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/numpy/core/_exceptions.py b/numpy/core/_exceptions.py index 3af006ca3..1dcea6255 100644 --- a/numpy/core/_exceptions.py +++ b/numpy/core/_exceptions.py @@ -131,7 +131,5 @@ class _ArrayMemoryError(MemoryError): self.dtype = dtype def __str__(self): - return "Attempted to allocate array with shape " + \ - str(self.shape).rstrip(')').rstrip(',') + ") and data type " + \ - str(self.dtype) + "." + return "Unable to allocate array with shape {} and data type {}".format(self.shape, self.dtype) |