Commit 3bd0ad93 authored by Stefan Behnel's avatar Stefan Behnel

remove references to 'minierror' module from Shadow.py

parent 2e884463
# cython.* namespace for pure mode. # cython.* namespace for pure mode.
__version__ = "0.18b1" __version__ = "0.18b1"
# Shamelessly copied from Cython/minivect/minitypes.py
# BEGIN shameless copy from Cython/minivect/minitypes.py
class _ArrayType(object): class _ArrayType(object):
...@@ -26,6 +27,11 @@ class _ArrayType(object): ...@@ -26,6 +27,11 @@ class _ArrayType(object):
return "%s[%s]" % (self.dtype, ", ".join(axes)) return "%s[%s]" % (self.dtype, ", ".join(axes))
class InvalidTypeSpecification(Exception):
pass
def index_type(base_type, item): def index_type(base_type, item):
""" """
Support array type creation by slicing, e.g. double[:, :] specifies Support array type creation by slicing, e.g. double[:, :] specifies
...@@ -36,7 +42,7 @@ def index_type(base_type, item): ...@@ -36,7 +42,7 @@ def index_type(base_type, item):
def verify_slice(s): def verify_slice(s):
if s.start or s.stop or s.step not in (None, 1): if s.start or s.stop or s.step not in (None, 1):
raise minierror.InvalidTypeSpecification( raise InvalidTypeSpecification(
"Only a step of 1 may be provided to indicate C or " "Only a step of 1 may be provided to indicate C or "
"Fortran contiguity") "Fortran contiguity")
...@@ -45,7 +51,7 @@ def index_type(base_type, item): ...@@ -45,7 +51,7 @@ def index_type(base_type, item):
for idx, s in enumerate(item): for idx, s in enumerate(item):
verify_slice(s) verify_slice(s)
if s.step and (step_idx or idx not in (0, len(item) - 1)): if s.step and (step_idx or idx not in (0, len(item) - 1)):
raise minierror.InvalidTypeSpecification( raise InvalidTypeSpecification(
"Step may only be provided once, and only in the " "Step may only be provided once, and only in the "
"first or last dimension.") "first or last dimension.")
...@@ -61,6 +67,7 @@ def index_type(base_type, item): ...@@ -61,6 +67,7 @@ def index_type(base_type, item):
# END shameless copy # END shameless copy
compiled = False compiled = False
_Unspecified = object() _Unspecified = object()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment