Skip to content

Commit 8062e17

Browse files
author
Kevin D Smith
committed
Fix bytes call for Python 2.7
1 parent 0d5f01b commit 8062e17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

swat/cas/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def _detect_protocol(self, hostname, port, protocol=None):
403403
try:
404404
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
405405
sock.connect((hostname, port))
406-
sock.send(bytes('GET /cas HTTP/1.1\r\nHost: %s\r\nConnection: close\r\nUser-Agent: Python-SWAT\r\nCache-Control: no-cache\r\n\r\n' % hostname, 'utf8'))
406+
sock.send(('GET /cas HTTP/1.1\r\nHost: %s\r\nConnection: close\r\nUser-Agent: Python-SWAT\r\nCache-Control: no-cache\r\n\r\n' % hostname).encode('utf8'))
407407

408408
if sock.recv(4).decode('utf-8').lower() == 'http':
409409
protocol = ptype

0 commit comments

Comments
 (0)