[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 826ca122875d36ee2fea362473cedafd289fd739
Author: Arturo Filastò <art@xxxxxxxxx>
Date:   Mon Nov 12 09:37:29 2012 +0100

    Trap exceptions properly in input unit
    (cherry picked from commit bd410ffc7bca234d8d6a3bc53bbfa93d21f76c47)
---
 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)



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits