diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-30 15:33:09 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-08-30 15:33:09 +0100 |
commit | 7021d8b73b374118458c81249e3a8a586983e136 (patch) | |
tree | 15d05e892a143297294682bbc6a088f477c2d40c /morphlib | |
parent | 9c556bec4760b1eed04740d8d2bc6b76f0dd04c7 (diff) | |
download | morph-7021d8b73b374118458c81249e3a8a586983e136.tar.gz |
Avoid editing a list while iterating it
Fixes previous commit where multiple hidden directories need to be
removed.
Diffstat (limited to 'morphlib')
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 3 |
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: |