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
changes/55/290255/4
ChangBo Guo(gcb) 7 years ago committed by Alexis Lee
parent 3976e7e4c5
commit 0d10f6b1fe
  1. 3
      doc/source/conf.py

@ -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

Loading…
Cancel
Save