Output busnum and devnum when failing to open mtp device

This commit is contained in:
Kovid Goyal 2014-08-26 06:56:57 +05:30
parent ab1c011419
commit 85a69325ea

View File

@ -219,7 +219,7 @@ Device_init(Device *self, PyObject *args, PyObject *kwds)
Py_BEGIN_ALLOW_THREADS;
dev = LIBMTP_Open_Raw_Device_Uncached(&rdev);
Py_END_ALLOW_THREADS;
if (dev == NULL) { free(rawdevs); PyErr_SetString(MTPError, "Unable to open raw device."); return -1; }
if (dev == NULL) { free(rawdevs); PyErr_Format(MTPError, "Unable to open raw device with busnum=%lu and devnum=%u", busnum, devnum); return -1; }
break;
}
}