result = module.fillinfo()
assert "hello, world." == result
+ PyBuffer_Release releases the resources held by a Py_buffer.
+ def test_decrefObject(self):
+ The PyObject referenced by Py_buffer.obj has its reference count
+ decremented by PyBuffer_Release.
+ module = self.import_extension('foo', [
+ ("release", "METH_VARARGS",
+ buf.obj = PyString_FromString("release me!");
+ buf.buf = PyString_AsString(buf.obj);
+ buf.len = PyString_Size(buf.obj);
+ /* The Py_buffer owns the only reference to that string. Release the
+ * Py_buffer and the string should be released as well.
+ assert module.release() is None