diff --git a/master/buildbot/scripts/base.py b/master/buildbot/scripts/base.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/scripts/base.py
+++ b/master/buildbot/scripts/base.py
@@ -229,7 +229,7 @@ class SubcommandOptions(usage.Options):
                         raise
                     break
 
-        for k in localDict.keys():
+        for k in list(localDict.keys()):  # pylint: disable=consider-iterating-dictionary
             if k.startswith("__"):
                 del localDict[k]
         return localDict
pylint: disable warning