mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Minor cleanups.
This commit is contained in:
parent
a5e40a9f25
commit
481b12293e
@ -375,7 +375,7 @@ class PRS500Device(Device):
|
||||
rsize = size
|
||||
if size % msize:
|
||||
rsize = size - size % msize + msize
|
||||
data = data_type(self.handle.bulk_read(self.BULK_IN_EP, rsize)[:size])
|
||||
data = data_type(self.handle.bulk_read(self.BULK_IN_EP, rsize))
|
||||
if self.log_packets:
|
||||
self.log_packet(data, "Answer d->h")
|
||||
return data
|
||||
|
@ -253,6 +253,8 @@ class DeviceHandle(Structure):
|
||||
if rsize < 0:
|
||||
raise Error('Could not read ' + str(size) + ' bytes on the '\
|
||||
'bulk bus. Error code: ' + str(rsize))
|
||||
if rsize < size:
|
||||
arr = arr[:rsize]
|
||||
return arr
|
||||
|
||||
def bulk_write(self, endpoint, bytes, timeout=100):
|
||||
|
Loading…
x
Reference in New Issue
Block a user