Skip to content

Commit

Permalink
Use six.iteritems instead of .iteritems for Python 3.
Browse files Browse the repository at this point in the history
And in one place, `list(six.iterkeys(<obj>))`, as the values didn't
appear to be used.
  • Loading branch information
thanatos committed Feb 27, 2016
1 parent 3a303db commit b965e83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions letsencrypt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def _restore_plugin_configs(config, renewalparams):
if renewalparams.get("installer", None) is not None:
plugin_prefixes.append(renewalparams["installer"])
for plugin_prefix in set(plugin_prefixes):
for config_item, config_value in renewalparams.iteritems():
for config_item, config_value in six.iteritems(renewalparams):
if config_item.startswith(plugin_prefix + "_") and not _set_by_cli(config_item):
# Values None, True, and False need to be treated specially,
# As they don't get parsed correctly based on type
Expand Down Expand Up @@ -1163,7 +1163,7 @@ class HelpfulArgumentParser(object):
"paths", "automation", "testing"] + list(six.iterkeys(VERBS))

def __init__(self, args, plugins, detect_defaults=False):
plugin_names = [name for name, _p in plugins.iteritems()]
plugin_names = list(six.iterkeys(plugins))
self.help_topics = self.HELP_TOPICS + plugin_names + [None]
usage, short_usage = usage_strings(plugins)
self.parser = configargparse.ArgParser(
Expand Down Expand Up @@ -1433,7 +1433,7 @@ def add_plugin_args(self, plugins):
may or may not be displayed as help topics.
"""
for name, plugin_ep in plugins.iteritems():
for name, plugin_ep in six.iteritems(plugins):
parser_or_group = self.add_group(name, description=plugin_ep.description)
#print(parser_or_group)
plugin_ep.plugin_cls.inject_parser_options(parser_or_group, name)
Expand Down Expand Up @@ -1828,7 +1828,7 @@ def _process_domain(args_or_config, domain_arg, webroot_path=None):
class WebrootMapProcessor(argparse.Action): # pylint: disable=missing-docstring
def __call__(self, parser, args, webroot_map_arg, option_string=None):
webroot_map = json.loads(webroot_map_arg)
for domains, webroot_path in webroot_map.iteritems():
for domains, webroot_path in six.iteritems(webroot_map):
_process_domain(args, domains, [webroot_path])


Expand Down

0 comments on commit b965e83

Please sign in to comment.