summaryrefslogtreecommitdiff
path: root/metaserver/pipelayer.py
diff options
context:
space:
mode:
authorDiego Roversi <diegor@tiscali.it>2019-09-08 22:05:57 +0200
committerDiego Roversi <diegor@tiscali.it>2019-09-08 22:05:57 +0200
commitc23b138ed72d794521b19ff7d8076b32b0b7bf46 (patch)
treec8e82a4ca4da05ba1ad28d4ff64a157bc1eb7952 /metaserver/pipelayer.py
parent1d9925c287b318ec21343e2682b51ab6a36ae8db (diff)
2to3
Diffstat (limited to 'metaserver/pipelayer.py')
-rw-r--r--metaserver/pipelayer.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/metaserver/pipelayer.py b/metaserver/pipelayer.py
index 9baf78a..82a8cd9 100644
--- a/metaserver/pipelayer.py
+++ b/metaserver/pipelayer.py
@@ -209,7 +209,7 @@ class PipeLayer(object):
def bad_crc(self):
import sys
- print >> sys.stderr, "warning: bad crc on udp connexion"
+ print("warning: bad crc on udp connexion", file=sys.stderr)
self.in_outoforder.clear()
self.out_flags = FLAG_NAK
self.out_nextrepeattime = self.cur_time
@@ -217,15 +217,15 @@ class PipeLayer(object):
_dump_indent = 0
def dump(self, dir, rawdata):
in_flags, ack_seqid, in_seqid = struct.unpack("!BBH", rawdata[:4])
- print ' ' * self._dump_indent, dir,
+ print(' ' * self._dump_indent, dir, end=' ')
if in_flags == FLAG_NAK:
- print 'NAK',
+ print('NAK', end=' ')
elif in_flags == FLAG_NAK1:
- print 'NAK1',
+ print('NAK1', end=' ')
elif in_flags == FLAG_CFRM:
- print 'CFRM',
+ print('CFRM', end=' ')
#print ack_seqid, in_seqid, '(%d bytes)' % (len(rawdata)-4,)
- print ack_seqid, in_seqid, repr(rawdata[4:])
+ print(ack_seqid, in_seqid, repr(rawdata[4:]))
def pipe_over_udp(udpsock, send_fd=-1, recv_fd=-1,
@@ -281,11 +281,11 @@ def pipe_over_udp(udpsock, send_fd=-1, recv_fd=-1,
class PipeOverUdp(object):
def __init__(self, udpsock, timeout=1.0):
- import thread, os
+ import _thread, os
self.os = os
self.sendpipe = os.pipe()
self.recvpipe = os.pipe()
- thread.start_new_thread(pipe_over_udp, (udpsock,
+ _thread.start_new_thread(pipe_over_udp, (udpsock,
self.sendpipe[0],
self.recvpipe[1],
timeout))