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
This commit is contained in:
Vu Cong Tuan 2017-06-04 10:56:37 +07:00
parent a29c084cb1
commit 1a0ee9a787
1 changed files with 1 additions and 2 deletions

View File

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