From 1a0ee9a787ebe61cc5b2df7d32f4a921efd2a45a Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Sun, 4 Jun 2017 10:56:37 +0700 Subject: [PATCH] Fix html_last_updated_fmt for Python3 Changing Popen to .check_output because of 2 reasons: 1. check_output() will raise CalledProcessError if the called process returns a non-zero return code. 2. For consistency with keystone [1] and cinder [2] [1] https://review.openstack.org/#/c/457142/ [2] https://review.openstack.org/#/c/433081 Change-Id: I1033016ffdaa83e216cffab7cf9713bee7fba758 --- doc/source/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 62b21197..6ffc86af 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -62,8 +62,7 @@ htmlhelp_basename = '%sdoc' % project 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].decode('utf-8') + 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".')