aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Marvin Schmidt <marv@exherbo.org> 2019-08-20 17:59:25 +0200
committerAvatar Marvin Schmidt <marv@exherbo.org> 2019-10-22 20:10:52 +0200
commitea2d768830f6e6817279cee525874b44efa50bfe (patch)
treef6fe29dc915ddaf18e4bfa251890f8e178fa8264
parentd58d9f78ef0cdf68ae1439ef049bff7101e7f310 (diff)
downloadpaludis-ea2d768830f6e6817279cee525874b44efa50bfe.tar.gz
paludis-ea2d768830f6e6817279cee525874b44efa50bfe.tar.xz
hooker_TEST: make ordering/py_hook Python3 compatible
Otherwise the test fails with the following error when using Python 3: 13: [ RUN ] Hooker.Ordering 13: paludis@1565848657: [WARNING hook.python.failure] Hook 'hooker_TEST_dir/ordering/py_hook.py': running hook_run_ordering function failed: 'Traceback (most recent call last): 13: File "hooker_TEST_dir/ordering/py_hook.py", line 2, in hook_run_ordering 13: file("hooker_TEST_dir/ordering.out", "a").write("py_hook\n") 13: NameError: name 'file' is not defined' 13: ../paludis/hooker_TEST.cc:76: Failure 13: Expected equality of these values: 13: 0 13: result.max_exit_status() 13: Which is: 1 13: ../paludis/hooker_TEST.cc:83: Failure 13: Expected equality of these values: 13: "e\nc\nf\nd\nb\na\npy_hook\ng\ni\nh\nsohook\nk\nj\n" 13: line 13: Which is: "e\nc\nf\nd\nb\na\ng\ni\nh\nsohook\nk\nj\n" 13: With diff: 13: @@ -5,5 @@ 13: b 13: a 13: -py_hook 13: g 13: i 13: 13: [ FAILED ] Hooker.Ordering (184 ms)
-rwxr-xr-xpaludis/hooker_TEST_setup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/paludis/hooker_TEST_setup.sh b/paludis/hooker_TEST_setup.sh
index bc8228eb6..0659b028f 100755
--- a/paludis/hooker_TEST_setup.sh
+++ b/paludis/hooker_TEST_setup.sh
@@ -226,7 +226,7 @@ done
ln -s ${TOP_BUILDDIR}/paludis/libpaludissohooks_TEST_${PALUDIS_PC_SLOT}.so.${SO_SUFFIX} ordering
cat <<"END" > ordering/py_hook.py
def hook_run_ordering(env, hook_env):
- file("hooker_TEST_dir/ordering.out", "a").write("py_hook\n")
+ open("hooker_TEST_dir/ordering.out", "a").write("py_hook\n")
def hook_depend_ordering(hook_env):
return ["f"]
END