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:
Jeremy Audet 2015-12-08 09:39:45 -05:00
parent 9c4eae5253
commit 5cac8efd73
2 changed files with 14 additions and 13 deletions

View file

@ -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")