[tor-commits] [ooni-probe/master] Trap exceptions properly in input unit

art at torproject.org art at torproject.org
Mon Nov 12 19:14:03 UTC 2012


commit bd410ffc7bca234d8d6a3bc53bbfa93d21f76c47
Author: Arturo Filastò <art at fuffa.org>
Date:   Mon Nov 12 09:37:29 2012 +0100

    Trap exceptions properly in input unit
---
 ooni/inputunit.py |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/ooni/inputunit.py b/ooni/inputunit.py
index 65f6d91..65d578c 100644
--- a/ooni/inputunit.py
+++ b/ooni/inputunit.py
@@ -37,7 +37,7 @@ class InputUnitFactory(object):
         for i in xrange(self._idx, self._idx + self.inputUnitSize):
             try:
                 input_unit_elements.append(self._inputs.next())
-            except:
+            except StopIteration:
                 self._ended = True
                 break
         self._idx += self.inputUnitSize
@@ -66,10 +66,7 @@ class InputUnit(object):
         return self
 
     def next(self):
-        try:
-            return self._inputs.next()
-        except:
-            raise StopIteration
+        return self._inputs.next()
 
     def append(self, input):
         self._inputs.append(input)





More information about the tor-commits mailing list