Skip to content

Commit bb79856

Browse files
DummyIntermediateDevice: Close DummyIntermediateDevice branch
1 parent 64760c7 commit bb79856

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Camera.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ def initialise_sockets(self, host, port):
238238
assert str(int(port)) == port, 'Port must be an integer.'
239239
s.settimeout(10)
240240
s.connect((host, int(port)))
241-
s.send('hello\r\n')
242-
response = s.recv(1024)
241+
s.send(b'hello\r\n')
242+
response = s.recv(1024).decode('utf8')
243243
s.close()
244244
if 'hello' in response:
245245
return True
@@ -262,12 +262,12 @@ def transition_to_buffered_sockets(self, h5file, host, port):
262262
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
263263
s.settimeout(120)
264264
s.connect((host, int(port)))
265-
s.send('%s\r\n'%h5file)
266-
response = s.recv(1024)
265+
s.send(b'%s\r\n' % h5file.encode('utf-8'))
266+
response = s.recv(1024).decode('utf8')
267267
if not 'ok' in response:
268268
s.close()
269269
raise Exception(response)
270-
response = s.recv(1024)
270+
response = s.recv(1024).decode('utf8')
271271
if not 'done' in response:
272272
s.close()
273273
raise Exception(response)
@@ -288,12 +288,12 @@ def transition_to_manual_sockets(self, host, port):
288288
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
289289
s.settimeout(120)
290290
s.connect((host, int(port)))
291-
s.send('done\r\n')
292-
response = s.recv(1024)
291+
s.send(b'done\r\n')
292+
response = s.recv(1024).decode('utf8')
293293
if response != 'ok\r\n':
294294
s.close()
295295
raise Exception(response)
296-
response = s.recv(1024)
296+
response = s.recv(1024).decode('utf8')
297297
if not 'done' in response:
298298
s.close()
299299
raise Exception(response)
@@ -317,8 +317,8 @@ def abort_sockets(self, host, port):
317317
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
318318
s.settimeout(120)
319319
s.connect((host, int(port)))
320-
s.send('abort\r\n')
321-
response = s.recv(1024)
320+
s.send(b'abort\r\n')
321+
response = s.recv(1024).decode('utf8')
322322
if not 'done' in response:
323323
s.close()
324324
raise Exception(response)

0 commit comments

Comments
 (0)