Don't alter dict keys in OSSA list iteration

Fix a breaking error for docs generation under Python 3.8 by working
from a copy of dict keys when iterating, so that the originals can
be altered within the loop.

Change-Id: I4ce90a163ce143d0b88ec722549750847bf4bf18
This commit is contained in:
Jeremy Stanley 2020-08-21 21:24:11 +00:00
parent 1c9dc3d832
commit 45150323ff

View File

@ -13,7 +13,7 @@ LOG = logging.getLogger(__name__)
def to_snake_case(d):
for k in d:
for k in dict(d):
v = d[k]
del d[k]
d[k.replace('-', '_')] = v