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

Add warning to indicate something is wrong when getting last updated
information from git repository.

Change-Id: Ie1ff9d77c30e4d5601443ece992968593fc1b8c1
This commit is contained in:
ChangBo Guo(gcb) 2016-03-14 11:06:53 +08:00
parent 8be653361f
commit 5b3086eef5
1 changed files with 3 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import os
import subprocess
import sys
import time
import warnings
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@ -137,6 +138,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()
# If true, SmartyPants will be used to convert quotes and dashes to