[PATCHv2 1/3] git-p4 tests: cd to / before running python
- From
Luke Diamand <luke@diamand.org>
- Date
- Apr 26, 2016, 07:50 UTC
- Message-ID
- <1461657061-7984-2-git-send-email-luke@diamand.org>
- In-Reply-To
- <1461657061-7984-1-git-send-email-luke@diamand.org>
The python one-liner for getting the current time prints out error messages if the current directory is deleted while it is running if using python3.
Avoid these messages by switching to "/" before running it.
This problem does not arise if using python2.
Signed-off-by: Luke Diamand <luke@diamand.org> --- t/lib-git-p4.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index f9ae1d7..724bc43 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -50,7 +50,7 @@ native_path() { # at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)' # function could fix that but it is not in Python until 3.3. time_in_seconds() { - python -c 'import time; print int(time.time())' + (cd / && python -c 'import time; print(int(time.time()))') } # Try to pick a unique port: guess a large number, then hope
-- 2.8.1.218.gd2cea43.dirty