Merge branch 'ld/p4-test-py3'
authorJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2016 21:45:42 +0000 (14:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 May 2016 21:45:42 +0000 (14:45 -0700)
The test scripts for "git p4" (but not "git p4" implementation
itself) has been updated so that they would work even on a system
where the installed version of Python is python 3.

* ld/p4-test-py3:
git-p4 tests: time_in_seconds should use $PYTHON_PATH
git-p4 tests: work with python3 as well as python2
git-p4 tests: cd to / before running python

1  2 
t/lib-git-p4.sh
diff --cc t/lib-git-p4.sh
index ce3536e4a02fb000ed2404f4c7c4c26bb8ea9d99,012d40e74695f8c195236a22802fd3ca6d60a8d8..54fd5a6ca02757f77004d0f8babfcc6d616162c0
@@@ -49,8 -49,8 +49,8 @@@ native_path () 
  # Attention: This function is not safe again against time offset updates
  # 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() {
 +time_in_seconds () {
-       python -c 'import time; print int(time.time())'
+       (cd / && "$PYTHON_PATH" -c 'import time; print(int(time.time()))')
  }
  
  # Try to pick a unique port: guess a large number, then hope