diff options
author | Luke Diamand <luke@diamand.org> | 2016-04-26 08:51:00 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-26 10:48:13 -0700 |
commit | 84096814a82eeb9c23bfc2b8ad7709d2c616b07d (patch) | |
tree | 5e321280207fac88b9d3b7d532985844a1c51c15 /t/t9802-git-p4-filetype.sh | |
parent | d1deaf4d02065fd8a1ace538df22a2125cf0b994 (diff) | |
download | git-84096814a82eeb9c23bfc2b8ad7709d2c616b07d.tar.gz git-84096814a82eeb9c23bfc2b8ad7709d2c616b07d.tar.xz |
git-p4 tests: work with python3 as well as python2
Update the git-p4 tests so that they work with both
Python2 and Python3.
We have to be explicit about the difference between
Unicode text strings (Python3 default) and raw binary
strings which will be exchanged with Perforce.
Additionally, print always takes parentheses in Python3.
Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9802-git-p4-filetype.sh')
-rwxr-xr-x | t/t9802-git-p4-filetype.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/t9802-git-p4-filetype.sh b/t/t9802-git-p4-filetype.sh index 66d3fc91a..eb9a8ed19 100755 --- a/t/t9802-git-p4-filetype.sh +++ b/t/t9802-git-p4-filetype.sh @@ -223,12 +223,12 @@ build_gendouble() { import sys import struct - s = struct.pack(">LL18s", + s = struct.pack(b">LL18s", 0x00051607, # AppleDouble 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 } |