#-------------------------------------------------------------------
+cdef extern from "Python.h":
+
+ object PyByteArray_FromStringAndSize(char *s, Py_ssize_t len)
# Functions from HDF5 ARRAY (this is not part of HDF5 HL; it's private)
cdef extern from "H5ARRAY.h" nogil:
# Create a buffer to keep this info. It is important to do a
# copy, because we will dispose the buffer memory later on by
# calling the H5Dvlen_reclaim. PyBytes_FromStringAndSize does this.
- buf = PyBytes_FromStringAndSize(<char *>rdata[i].p,
- vllen*self._atomicsize)
+ buf = PyByteArray_FromStringAndSize(<char *>rdata[i].p,
+ vllen*self._atomicsize)
else:
# Case where there is info with zero lentgh
buf = None
"""Test for creation of non-homogeneous arrays."""
# This checks ticket #12.
- self.assertRaises(ValueError,
+ self.assertRaises((ValueError, TypeError),
self.h5file.create_array, '/', 'test', [1, [2, 3]])
self.assertRaises(NoSuchNodeError, self.h5file.remove_node, '/test')
print('\n', '-=' * 30)
print("Running test for %s" % (self.title))
a = self.charList
- with self.assertRaises(ValueError):
+ with self.assertRaises((ValueError, TypeError)):
WriteRead(self.h5fname, a)
def test01_types(self):
"""Non supported lists object (numerical types)"""
a = self.numericalList
- with self.assertRaises(ValueError):
+ with self.assertRaises((ValueError, TypeError)):
WriteRead(self.h5fname, a)