From 8542127f3bc823bbc7ff76e4ca8dc3bd0969318f Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 24 Apr 2009 23:03:51 +0000 Subject: Checkpoint svn path=/rpkid/pubd.py; revision=2355 --- rpkid/rpki/async.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'rpkid/rpki/async.py') diff --git a/rpkid/rpki/async.py b/rpkid/rpki/async.py index 1c0b5a02..74a23385 100644 --- a/rpkid/rpki/async.py +++ b/rpkid/rpki/async.py @@ -18,6 +18,8 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ +import rpki.log + class iterator(object): """Iteration construct for event-driven code. Takes three arguments: @@ -39,7 +41,11 @@ class iterator(object): def __init__(self, iterable, item_callback, done_callback): self.item_callback = item_callback self.done_callback = done_callback - self.iterator = iter(iterable) + try: + self.iterator = iter(iterable) + except: + rpki.log.debug("Problem constructing iterator for %s" % repr(iterable)) + raise self() def __call__(self, *ignored): -- cgit v1.2.3