aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/async.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-07-29 11:49:51 +0000
committerRob Austein <sra@hactrn.net>2009-07-29 11:49:51 +0000
commitecf44b9ceebbfc2f97867ae7f1896115e591552f (patch)
tree14c5b72006a31fbb69647868a7a90151b36769c4 /rpkid/rpki/async.py
parent118bc24016e7090bb1789da874a77cba50e1ce8a (diff)
Rework stack_unwind code
svn path=/rpkid/rpki/async.py; revision=2679
Diffstat (limited to 'rpkid/rpki/async.py')
-rw-r--r--rpkid/rpki/async.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/rpkid/rpki/async.py b/rpkid/rpki/async.py
index 7248e860..00ac3d11 100644
--- a/rpkid/rpki/async.py
+++ b/rpkid/rpki/async.py
@@ -46,7 +46,7 @@ class iterator(object):
self.item_callback = item_callback
self.done_callback = done_callback
self.caller_file, self.caller_line, self.caller_function = traceback.extract_stack(limit = 2)[0][0:3]
- self.timer = timer(handler = item_callback) if unwind_stack else None
+ self.timer = timer(handler = self.doit) if unwind_stack else None
try:
self.iterator = iter(iterable)
except (ExitNow, SystemExit):
@@ -54,10 +54,12 @@ class iterator(object):
except:
rpki.log.debug("Problem constructing iterator for %s" % repr(iterable))
raise
- self()
+ self.doit()
def __repr__(self):
- return "<%s created at %s:%d %s at 0x%x>" % (self.__class__.__name__, self.caller_file, self.caller_line, self.caller_function, id(self))
+ return ("<%s created at %s:%d %s at 0x%x>" %
+ (self.__class__.__name__,
+ self.caller_file, self.caller_line, self.caller_function, id(self)))
def __call__(self):
if self.timer is None: