This commit is contained in:
Kovid Goyal 2012-09-01 23:07:10 +05:30
parent 2e66bd1aa5
commit 468a47eb5d

View File

@ -564,9 +564,8 @@ class DeviceManager(Thread): # {{{
to_job=add_as_step_to_job)
def _view_book(self, path, target):
f = open(target, 'wb')
self.device.get_file(path, f)
f.close()
with open(target, 'wb') as f:
self.device.get_file(path, f)
return target
def view_book(self, done, path, target, add_as_step_to_job=None):