From 057c3f2947aae5699cfb0e2b4904be0c6500fc50 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 10 Apr 2017 22:41:52 +0300 Subject: [PATCH] python: specify python2 as .py interpreter On some distro the default python interpreter is Python 3, which results in such errors: > Running zdtm/static/socket-tcp-closed.hook(--post-start) > make[1]: Nothing to be done for default. > ./socket-tcp-closed --pidfile=socket-tcp-closed.pid --outfile=socket-tcp-closed.out > File "zdtm/static/socket-tcp-closed.hook", line 16 > except OSError, e: > ^ > SyntaxError: invalid syntax > ######### Test zdtm/static/socket-tcp-closed FAIL at hook --post-start ######### > Running zdtm/static/socket-tcp-closed.hook(--clean) > File "zdtm/static/socket-tcp-closed.hook", line 16 > except OSError, e: > ^ > SyntaxError: invalid syntax > Traceback (most recent call last): > File "zdtm.py", line 1921, in > do_run_test(tinfo[0], tinfo[1], tinfo[2], tinfo[3]) > File "zdtm.py", line 1388, in do_run_test > try_run_hook(t, ["--clean"]) > File "zdtm.py", line 1053, in try_run_hook > raise test_fail_exc("hook " + " ".join(args)) > __main__.test_fail_exc: <__main__.test_fail_exc instance at 0x76294468> Acked-by: Cyrill Gorcunov Signed-off-by: Dmitry Safonov Signed-off-by: Andrei Vagin --- coredump/criu-coredump | 2 +- crit/crit | 2 +- lib/py/images/images.py | 2 +- scripts/magic-gen.py | 2 +- test/check_actions.py | 2 +- test/others/ext-tty/run.py | 2 +- test/zdtm/static/socket-tcp-fin-wait1.hook | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/coredump/criu-coredump b/coredump/criu-coredump index b667e862a..25c188c6b 100755 --- a/coredump/criu-coredump +++ b/coredump/criu-coredump @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import argparse import os diff --git a/crit/crit b/crit/crit index cc3f5ab22..8b1e19bb9 100755 --- a/crit/crit +++ b/crit/crit @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import argparse import sys import json diff --git a/lib/py/images/images.py b/lib/py/images/images.py index c593a3b85..0edbe80ea 100644 --- a/lib/py/images/images.py +++ b/lib/py/images/images.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/bin/env python2 # This file contains methods to deal with criu images. # diff --git a/scripts/magic-gen.py b/scripts/magic-gen.py index 6719e4c3e..319e99812 100755 --- a/scripts/magic-gen.py +++ b/scripts/magic-gen.py @@ -1,4 +1,4 @@ -#!/bin/env python +#!/bin/env python2 import os, sys import struct diff --git a/test/check_actions.py b/test/check_actions.py index 70d257fbd..96c07a758 100755 --- a/test/check_actions.py +++ b/test/check_actions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import sys import os diff --git a/test/others/ext-tty/run.py b/test/others/ext-tty/run.py index 3806d5043..052f9c1a1 100755 --- a/test/others/ext-tty/run.py +++ b/test/others/ext-tty/run.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import subprocess import os, sys, time, signal, pty diff --git a/test/zdtm/static/socket-tcp-fin-wait1.hook b/test/zdtm/static/socket-tcp-fin-wait1.hook index ae0b51d39..9630e0d74 100755 --- a/test/zdtm/static/socket-tcp-fin-wait1.hook +++ b/test/zdtm/static/socket-tcp-fin-wait1.hook @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import sys sys.path.append("../crit")