doc:Log warning when can't get information from git

This is follow up of commit a1a1c89c0d,
add warning to indicate something is wrong when getting last updated
information from git repository.

Related-Bug: #1552251
Change-Id: I1ba2d4fe1fb3909742bd1a2f552e917effb35faa
This commit is contained in:
ChangBo Guo(gcb) 2016-03-09 11:21:04 +08:00 committed by Alexis Lee
parent 3976e7e4c5
commit 0d10f6b1fe
1 changed files with 3 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import os
import subprocess
import sys
import time
import warnings
sys.path.insert(0, os.path.abspath('../..'))
# -- General configuration ----------------------------------------------------
@ -64,6 +65,8 @@ try:
html_last_updated_fmt = subprocess.Popen(
git_cmd, stdout=subprocess.PIPE).communicate()[0]
except Exception:
warnings.warn('Cannot get last updated time from git repository, '
'using current time.')
html_last_updated_fmt = time.ctime()
# Grouping the document tree into LaTeX files. List of tuples