python3: Ensure ConfigOpts __iter__ uses list(d.keys())

d.keys() no longer returns a copy of the keys in Python 3.
This is part of PEP 3106.

Change-Id: Ie4897109c87d6dc2952c2eb35b83fe368fb31803
Closes-Bug: #1796163
This commit is contained in:
Corey Bryant 2018-10-04 15:29:36 -04:00
parent e22a002f43
commit 1884c307a9
1 changed files with 2 additions and 1 deletions

View File

@ -2649,7 +2649,8 @@ class ConfigOpts(collections.Mapping):
def __iter__(self):
"""Iterate over all registered opt and group names."""
for key in itertools.chain(self._opts.keys(), self._groups.keys()):
for key in itertools.chain(list(self._opts.keys()),
list(self._groups.keys())):
yield key
def __len__(self):