From 07bf89a98e23a20e5041739f851513f0dfc8caed Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 22 May 2015 16:38:43 -0700 Subject: [PATCH] Use os.getcwd() instead of shelling out to run pwd Change-Id: I78d8b41c43fe957684391c100fb61644a52887b1 --- README.rst | 2 +- doc/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index eae1c891..0d8a8ca5 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,7 @@ metadata for the project where the docs reside:: git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" gitsha = os.popen(git_cmd).read().strip('\n') # source tree - pwd = os.popen("pwd").read().strip('\n') + pwd = os.getcwd() # html_context allows us to pass arbitrary values into the html template html_context = {"pwd": pwd, "gitsha": gitsha} # Must set this variable to include year, month, day, hours, and minutes. diff --git a/doc/source/conf.py b/doc/source/conf.py index 1d64ef3d..4322ca2d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -66,7 +66,7 @@ release = '1.0' git_cmd = "/usr/bin/git log | head -n1 | cut -f2 -d' '" gitsha = os.popen(git_cmd).read().strip('\n') # source tree -pwd = os.popen("pwd").read().strip('\n') +pwd = os.getcwd() # html_context allows us to pass arbitrary values into the html template html_context = { "pwd":pwd, "gitsha":gitsha }