This commit is contained in:
Kovid Goyal 2012-08-08 11:09:13 +05:30
parent 3466c1a7c4
commit cf567afbd1

View File

@ -484,7 +484,9 @@ libmtp_Device_put_file(libmtp_Device *self, PyObject *args, PyObject *kwargs) {
dump_errorstack(self->device, errs); dump_errorstack(self->device, errs);
fo = Py_None; Py_INCREF(fo); fo = Py_None; Py_INCREF(fo);
} else { } else {
Py_BEGIN_ALLOW_THREADS;
nf = LIBMTP_Get_Filemetadata(self->device, f.item_id); nf = LIBMTP_Get_Filemetadata(self->device, f.item_id);
Py_END_ALLOW_THREADS;
if (nf == NULL) { if (nf == NULL) {
dump_errorstack(self->device, errs); dump_errorstack(self->device, errs);
fo = Py_None; Py_INCREF(fo); fo = Py_None; Py_INCREF(fo);
@ -518,7 +520,9 @@ libmtp_Device_delete_object(libmtp_Device *self, PyObject *args, PyObject *kwarg
errs = PyList_New(0); errs = PyList_New(0);
if (errs == NULL) { PyErr_NoMemory(); return NULL; } if (errs == NULL) { PyErr_NoMemory(); return NULL; }
Py_BEGIN_ALLOW_THREADS;
res = LIBMTP_Delete_Object(self->device, id); res = LIBMTP_Delete_Object(self->device, id);
Py_END_ALLOW_THREADS;
if (res != 0) dump_errorstack(self->device, errs); if (res != 0) dump_errorstack(self->device, errs);
return Py_BuildValue("ON", (res == 0) ? Py_True : Py_False, errs); return Py_BuildValue("ON", (res == 0) ? Py_True : Py_False, errs);