diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index 0e19482061..e201186672 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -171,8 +171,8 @@ pygments_style = 'sphinx' git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", "-n1"] try: - html_last_updated_fmt = subprocess.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] + html_last_updated_fmt = subprocess.check_output( + git_cmd).decode('utf-8') except Exception: warnings.warn('Cannot get last updated time from git repository. ' 'Not setting "html_last_updated_fmt".') diff --git a/doc/ext/support_matrix.py b/doc/ext/support_matrix.py index c7e14046cd..c7e53fc13b 100644 --- a/doc/ext/support_matrix.py +++ b/doc/ext/support_matrix.py @@ -319,8 +319,7 @@ class SupportMatrixDirective(rst.Directive): summaryhead.append(header) # then one column for each hypervisor driver - impls = matrix.targets.keys() - impls.sort() + impls = sorted(matrix.targets.keys()) for key in impls: target = matrix.targets[key] implcol = nodes.entry() @@ -352,8 +351,7 @@ class SupportMatrixDirective(rst.Directive): classes=["sp_feature_" + feature.status])) # and then one column for each hypervisor driver - impls = matrix.targets.keys() - impls.sort() + impls = sorted(matrix.targets.keys()) for key in impls: target = matrix.targets[key] impl = feature.implementations[key] diff --git a/doc/source/conf.py b/doc/source/conf.py index 755652e93f..6cf48b5729 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -167,8 +167,8 @@ html_static_path = ['_static'] git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local", "-n1"] try: - html_last_updated_fmt = subprocess.Popen( - git_cmd, stdout=subprocess.PIPE).communicate()[0] + html_last_updated_fmt = subprocess.check_output( + git_cmd).decode('utf-8') except Exception: warnings.warn('Cannot get last updated time from git repository. ' 'Not setting "html_last_updated_fmt".')