|
|
@@ -3196,11 +3196,11 @@ SWIG_AsVal_unsigned_SS_short (PyObject * obj, unsigned short *val) |
|
|
|
|
|
|
|
PyObject *archive_read_data_into_str(struct archive *archive, int len) { |
|
|
|
PyObject *str = NULL; |
|
|
|
if (!(str = PyUnicode_FromStringAndSize(NULL, len))) { |
|
|
|
if (!(str = PyBytes_FromStringAndSize(NULL, len))) { |
|
|
|
PyErr_SetString(PyExc_MemoryError, "could not allocate string."); |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
if (len != archive_read_data(archive, PyUnicode_AS_DATA(str), len)) { |
|
|
|
if (len != archive_read_data(archive, PyBytes_AS_STRING(str), len)) { |
|
|
|
PyErr_SetString(PyExc_RuntimeError, "could not read requested data."); |
|
|
|
return NULL; |
|
|
|
} |
|
|
|