mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Make "make webdocs" compatible with Python 3
The `webdocs` make target fails under Python 3. It fails due to a variety of syntax errors, such as the use of `except Foo, e` and `print 'foo'`. Fix #13463 by making code compatible with both Python 2 and 3.
This commit is contained in:
parent
9c4eae5253
commit
5cac8efd73
2 changed files with 14 additions and 13 deletions
|
@ -140,7 +140,7 @@ def list_modules(module_dir, depth=0):
|
|||
if os.path.isdir(d):
|
||||
|
||||
res = list_modules(d, depth + 1)
|
||||
for key in res.keys():
|
||||
for key in list(res.keys()):
|
||||
if key in categories:
|
||||
categories[key] = merge_hash(categories[key], res[key])
|
||||
res.pop(key, None)
|
||||
|
@ -451,7 +451,7 @@ def main():
|
|||
|
||||
categories = list_modules(options.module_dir)
|
||||
last_category = None
|
||||
category_names = categories.keys()
|
||||
category_names = list(categories.keys())
|
||||
category_names.sort()
|
||||
|
||||
category_list_path = os.path.join(options.output_dir, "modules_by_category.rst")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue