move exception class into shadow function as we may not want to export it under the...
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 20 Jan 2013 07:08:15 +0000 (08:08 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 20 Jan 2013 07:08:15 +0000 (08:08 +0100)
Cython/Shadow.py

index c6f8018..5ee857b 100644 (file)
@@ -28,10 +28,6 @@ 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
@@ -40,6 +36,9 @@ def index_type(base_type, item):
     """
     assert isinstance(item, (tuple, slice))
 
+    class InvalidTypeSpecification(Exception):
+        pass
+
     def verify_slice(s):
         if s.start or s.stop or s.step not in (None, 1):
             raise InvalidTypeSpecification(