Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scan.py
diff options
context:
space:
mode:
Diffstat (limited to 'scan.py')
-rw-r--r--scan.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/scan.py b/scan.py
index cdd5cc8..9398f2f 100644
--- a/scan.py
+++ b/scan.py
@@ -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