mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-22 01:51:51 +00:00
This commit removes the dependency on the __future__ module, which was used to enable Python 3 features in Python 2 code. With support for Python 2 being dropped, it is no longer necessary to maintain backward compatibility. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
20 lines
452 B
Python
Executable File
20 lines
452 B
Python
Executable File
#!/usr/bin/env python3
|
|
|
|
import sys, socket
|
|
import hashlib
|
|
|
|
sk = socket.fromfd(3, socket.AF_INET, socket.SOCK_STREAM)
|
|
|
|
s = sys.stdin.read()
|
|
ret = sk.send(s)
|
|
print("%s: send() -> %d" % (sys.argv[1], ret), file=sys.stderr)
|
|
sk.shutdown(socket.SHUT_WR)
|
|
m = hashlib.md5()
|
|
while True:
|
|
s = sk.recv((1 << 20) * 10)
|
|
if not s:
|
|
break
|
|
print("%s: recv() -> %d" % (sys.argv[1], len(s)), file=sys.stderr)
|
|
m.update(s)
|
|
print(repr(m.hexdigest()))
|