diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2019-04-13 11:54:26 -0700 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2019-04-13 12:09:20 -0700 |
commit | 3b8bcc33e1fb75c7fed4cc0d83fd2640da5e1e77 (patch) | |
tree | eb6719232ea0e4251c85e168ac1e3fad5461e524 /numpy/core/_internal.py | |
parent | dea1239b6dcaf072fc9b70e6af0c0a100cead69e (diff) | |
download | numpy-3b8bcc33e1fb75c7fed4cc0d83fd2640da5e1e77.tar.gz |
MAINT: Move exceptions from core._internal to core._exceptions
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r-- | numpy/core/_internal.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py index 1d3bb5584..82035e561 100644 --- a/numpy/core/_internal.py +++ b/numpy/core/_internal.py @@ -10,7 +10,6 @@ import re import sys from numpy.compat import unicode -from numpy.core.overrides import set_module from .multiarray import dtype, array, ndarray try: import ctypes @@ -795,29 +794,6 @@ def _gcd(a, b): def _lcm(a, b): return a // _gcd(a, b) * b -# Exception used in shares_memory() -@set_module('numpy') -class TooHardError(RuntimeError): - pass - -@set_module('numpy') -class AxisError(ValueError, IndexError): - """ Axis supplied was invalid. """ - def __init__(self, axis, ndim=None, msg_prefix=None): - # single-argument form just delegates to base class - if ndim is None and msg_prefix is None: - msg = axis - - # do the string formatting here, to save work in the C code - else: - msg = ("axis {} is out of bounds for array of dimension {}" - .format(axis, ndim)) - if msg_prefix is not None: - msg = "{}: {}".format(msg_prefix, msg) - - super(AxisError, self).__init__(msg) - - def array_ufunc_errmsg_formatter(dummy, ufunc, method, *inputs, **kwargs): """ Format the error message for when __array_ufunc__ gives up. """ args_string = ', '.join(['{!r}'.format(arg) for arg in inputs] + |