Fix doc generation for Python3

Fix the Sphinx html_last_updated_fmt for Python3.
The html_last_updated_fmt option is interpeted as a
byte string in python3, causing Sphinx build to break.
This patch makes it utf-8 string.

Change-Id: Ie6efe365a17bdc73992696e866587a363bdbb900
This commit is contained in:
M V P Nitesh 2017-04-17 16:51:50 +05:30
parent cb62c9997a
commit 9ef77d7abc
2 changed files with 2 additions and 4 deletions

View File

@ -165,8 +165,7 @@ 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".')

View File

@ -167,8 +167,7 @@ modindex_common_prefix = ['searchlight.']
#html_last_updated_fmt = '%b %d, %Y'
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
"-n1"]
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')
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.