Use six to make this list + list work in Python 3.

The RHS here in Python 3 is a set-like object over keys; it's
essentially the same as .iterkeys() in Python 2. Unfortunately, + is not
defined for list + <dict>.keys().

In Python 3, it's idiomatic to simply list(VERBS.keys()) here;
basically, take that and use six to make it Python 2 compatible.
This commit is contained in:
Roy Wellington Ⅳ
2016-02-26 21:18:20 -08:00
parent d674a74ba1
commit 3a303dbf40
+2 -1
View File
@@ -19,6 +19,7 @@ import traceback
import configargparse
import OpenSSL
import six
import zope.component
import zope.interface.exceptions
import zope.interface.verify
@@ -1159,7 +1160,7 @@ class HelpfulArgumentParser(object):
# List of topics for which additional help can be provided
HELP_TOPICS = ["all", "security",
"paths", "automation", "testing"] + VERBS.keys()
"paths", "automation", "testing"] + list(six.iterkeys(VERBS))
def __init__(self, args, plugins, detect_defaults=False):
plugin_names = [name for name, _p in plugins.iteritems()]