From b91e13d5dfd1a3072df38eba63dfd7c954cc8641 Mon Sep 17 00:00:00 2001 From: fijal Date: Wed, 7 Feb 2007 00:13:50 +0100 Subject: [PATCH] [svn r38040] My favorite lazy-lexical-scope-binding error. Still thinking how to make test for that. Basically - callbacks with lexical scope variables are usually (depends of coz) called with variables after the for loop has finished. --HG-- branch : trunk --- py/test/rsession/hostmanage.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py/test/rsession/hostmanage.py b/py/test/rsession/hostmanage.py index e7ac8dcb1..253ab5996 100644 --- a/py/test/rsession/hostmanage.py +++ b/py/test/rsession/hostmanage.py @@ -133,10 +133,11 @@ class HostManager(object): verbose=self.config.option.verbose) destrelpath = root.relto(self.config.topdir) for host in self.hosts: - def donecallback(): + def donecallback(host, root): reporter(repevent.HostRSyncRootReady(host, root)) remotepath = rsync.add_target_host( - host, reporter, destrelpath, finishedcallback=donecallback) + host, reporter, destrelpath, finishedcallback= + lambda host=host, root=root: donecallback(host, root)) reporter(repevent.HostRSyncing(host, root, remotepath)) rsync.send(root)