aholkner  committed ad7fae3

Calculate default shape in array methods

  • Participants
  • Parent commits f69c6b3
  • Branches ctypes-soc

Comments (0)

Files changed (1)

File SDL/

             raise ImportError, 'numpy could not be imported'
         if self.ctype not in _numpy_typemap:
             raise TypeError, '%s has no numpy compatible type' % self.ctype
+        if shape is None:
+            shape = (self.count,)
         ar = numpy.frombuffer(self.as_ctypes(), _numpy_typemap[self.ctype])
         ar = ar.reshape(shape)
         return ar
         s = self.to_string()
         t = _default_typemap[self.ctype]
+        if shape is None:
+            shape = (self.count,)
         # Each module has its own shaping interface
         if _have_numpy and _default_array is numpy: