From 2e0ab62f8da2bd814c537e3eba063139d7ff3ec0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20HORTA?= Date: Tue, 23 Nov 2021 18:48:35 +0100 Subject: [PATCH] Use python2 for tests because for travis, fix valgrind list1 test --- tests/cached/valgrind-supressions | 1 + tests/functions | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 120000 tests/cached/valgrind-supressions diff --git a/tests/cached/valgrind-supressions b/tests/cached/valgrind-supressions new file mode 120000 index 00000000..e409c1e3 --- /dev/null +++ b/tests/cached/valgrind-supressions @@ -0,0 +1 @@ +../valgrind-supressions \ No newline at end of file diff --git a/tests/functions b/tests/functions index cafb5abf..bf6ed5a8 100644 --- a/tests/functions +++ b/tests/functions @@ -204,10 +204,11 @@ function run_cached { export RRDTOOL=RRDTOOLCOMPAT randport=$(python -S -c "import random; random.seed('$(basename $0)'); print(random.randrange(49152,65535))") - port=$(python -S << HERE -import socketserver -with socketserver.TCPServer(("localhost", 0), None) as s: - print(s.server_address[1]) + port=$(python2 -S << HERE +import SocketServer +s = SocketServer.TCPServer(("localhost", 0), None) +print(s.server_address[1]) +s.server_close() HERE ) ADDR="localhost:$port" -- 2.47.3