summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2012-08-30 15:33:09 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-08-30 15:33:09 +0100
commit7021d8b73b374118458c81249e3a8a586983e136 (patch)
tree15d05e892a143297294682bbc6a088f477c2d40c
parent9c556bec4760b1eed04740d8d2bc6b76f0dd04c7 (diff)
downloadmorph-7021d8b73b374118458c81249e3a8a586983e136.tar.gz
Avoid editing a list while iterating it
Fixes previous commit where multiple hidden directories need to be removed.
-rw-r--r--morphlib/plugins/branch_and_merge_plugin.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py
index 41bbadde..5accf076 100644
--- a/morphlib/plugins/branch_and_merge_plugin.py
+++ b/morphlib/plugins/branch_and_merge_plugin.py
@@ -15,6 +15,7 @@
import cliapp
+import copy
import os
import json
import glob
@@ -89,7 +90,7 @@ class BranchAndMergePlugin(cliapp.Plugin):
# Do not recurse deeper if we have more than one
# non-hidden directory.
- for d in subdirs:
+ for d in copy.copy(subdirs):
if d.startswith('.'):
subdirs.remove(d)
if len(subdirs) > 1: