test/others: drop setup_swrk() py2 compatibility

This patch removes the code introduced for compatibility
with Python 2 in commits:

4c1ee3e227
test/other: Resolve Py3 compatibility issues

6b615ca152
test/others: Reuse setup_swrk()

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2023-06-22 03:11:20 +01:00 committed by Andrei Vagin
parent cc5742d707
commit a8cfec9dc4

View file

@ -5,12 +5,6 @@ import subprocess
def setup_swrk():
print('Connecting to CRIU in swrk mode.')
s1, s2 = socket.socketpair(socket.AF_UNIX, socket.SOCK_SEQPACKET)
kwargs = {}
if sys.version_info.major == 3:
kwargs["pass_fds"] = [s1.fileno()]
swrk = subprocess.Popen(['./criu', "swrk", "%d" % s1.fileno()], **kwargs)
swrk = subprocess.Popen(['./criu', "swrk", "%d" % s1.fileno()], pass_fds=[s1.fileno()])
s1.close()
return swrk, s2