mirror of
https://github.com/git/git.git
synced 2025-04-01 05:09:22 +00:00
Merge branch 'ld/p4-test-py3'
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
This commit is contained in:
commit
ca158f4633
@ -50,7 +50,7 @@ native_path () {
|
|||||||
# at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)'
|
# at runtime (e.g. via NTP). The 'clock_gettime(CLOCK_MONOTONIC)'
|
||||||
# function could fix that but it is not in Python until 3.3.
|
# 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
|
# Try to pick a unique port: guess a large number, then hope
|
||||||
@ -207,9 +207,10 @@ marshal_dump () {
|
|||||||
cat >"$TRASH_DIRECTORY/marshal-dump.py" <<-EOF &&
|
cat >"$TRASH_DIRECTORY/marshal-dump.py" <<-EOF &&
|
||||||
import marshal
|
import marshal
|
||||||
import sys
|
import sys
|
||||||
|
instream = getattr(sys.stdin, 'buffer', sys.stdin)
|
||||||
for i in range($line):
|
for i in range($line):
|
||||||
d = marshal.load(sys.stdin)
|
d = marshal.load(instream)
|
||||||
print d['$what']
|
print(d[b'$what'].decode('utf-8'))
|
||||||
EOF
|
EOF
|
||||||
"$PYTHON_PATH" "$TRASH_DIRECTORY/marshal-dump.py"
|
"$PYTHON_PATH" "$TRASH_DIRECTORY/marshal-dump.py"
|
||||||
}
|
}
|
||||||
|
@ -223,12 +223,12 @@ build_gendouble() {
|
|||||||
import sys
|
import sys
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
s = struct.pack(">LL18s",
|
s = struct.pack(b">LL18s",
|
||||||
0x00051607, # AppleDouble
|
0x00051607, # AppleDouble
|
||||||
0x00020000, # version 2
|
0x00020000, # version 2
|
||||||
"" # pad to 26 bytes
|
b"" # pad to 26 bytes
|
||||||
)
|
)
|
||||||
sys.stdout.write(s)
|
getattr(sys.stdout, 'buffer', sys.stdout).write(s)
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user