From 9354e78871a7b11c511658c73904305d7dc58dc4 Mon Sep 17 00:00:00 2001 From: Alan Falloon Date: Thu, 15 Jan 2015 16:13:35 -0500 Subject: [PATCH] Null out lock vars so that __del__ gets called The builder was holding lock variables in the loop which means that sometimes a state.Lock object would be created for the same file-id twice, triggering the assertion. Assign the lock variables to None to ensure that the state.Lock objects are destroyed before creating the next one in the loop. --- builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builder.py b/builder.py index 7215ba8..f4bf00b 100644 --- a/builder.py +++ b/builder.py @@ -348,6 +348,7 @@ def main(targets, shouldbuildfunc): BuildJob(t, f, lock, shouldbuildfunc, done).start() state.commit() assert(state.is_flushed()) + lock = None del lock @@ -401,5 +402,6 @@ def main(targets, shouldbuildfunc): else: BuildJob(t, state.File(id=fid), lock, shouldbuildfunc, done).start() + lock = None state.commit() return retcode[0]