diff options
Diffstat (limited to 'scan.py')
-rw-r--r-- | scan.py | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -515,12 +515,17 @@ class ScanThread(threading.Thread): images = [] try: self._dpi = self._device.resolution - for image in scan_iter: - images.append(self._process_image(image)) - if self._check_action(['stop', 'quit']): - break + try: + for image in scan_iter: + images.append(self._process_image(image)) + if self._check_action(['stop', 'quit']): + break - self._dpi = self._device.resolution + self._dpi = self._device.resolution + except sane.error, exc: + # Work around python-sane bug. + if str(exc) != 'Document feeder out of documents': + raise self._images = images |