From 3bd0ad9379d9eb5597494dde9377fe5b5d9e89f3 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 19 Jan 2013 20:47:29 +0100 Subject: [PATCH] remove references to 'minierror' module from Shadow.py --- Cython/Shadow.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Cython/Shadow.py b/Cython/Shadow.py index 319302a..c6f8018 100644 --- a/Cython/Shadow.py +++ b/Cython/Shadow.py @@ -1,7 +1,8 @@ # cython.* namespace for pure mode. __version__ = "0.18b1" -# Shamelessly copied from Cython/minivect/minitypes.py + +# BEGIN shameless copy from Cython/minivect/minitypes.py class _ArrayType(object): @@ -26,6 +27,11 @@ class _ArrayType(object): return "%s[%s]" % (self.dtype, ", ".join(axes)) + +class InvalidTypeSpecification(Exception): + pass + + def index_type(base_type, item): """ Support array type creation by slicing, e.g. double[:, :] specifies @@ -36,7 +42,7 @@ def index_type(base_type, item): def verify_slice(s): 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 " "Fortran contiguity") @@ -45,7 +51,7 @@ def index_type(base_type, item): for idx, s in enumerate(item): verify_slice(s) 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 " "first or last dimension.") @@ -61,6 +67,7 @@ def index_type(base_type, item): # END shameless copy + compiled = False _Unspecified = object() -- 2.7.4