Merge "Replace deprecated library function os.popen() with subprocess"

This commit is contained in:
Zuul 2018-05-30 20:25:48 +00:00 committed by Gerrit Code Review
commit 3701eb0a6c

@ -13,6 +13,7 @@
# flake8: noqa
import subprocess
import sys
import os
@ -136,8 +137,10 @@ html_extra_path = ['_extra']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
git_cmd = "git log --pretty=format:'%ad, commit %h' --date=local -n1"
html_last_updated_fmt = os.popen(git_cmd).read()
git_cmd = ["git", "log", "--pretty=format:'%ad, commit %h'", "--date=local",
"-n1"]
html_last_updated_fmt = str(subprocess.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0])
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.