Fix UpnpPunch py3 compatibility
This commit is contained in:
parent
e97873fb7e
commit
65705aba10
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ def perform_m_search(local_ip):
|
||||||
'MX: 2\r\n',
|
'MX: 2\r\n',
|
||||||
'ST: {0}\r\n'.format(search_target),
|
'ST: {0}\r\n'.format(search_target),
|
||||||
'\r\n']
|
'\r\n']
|
||||||
)
|
).encode("utf8")
|
||||||
|
|
||||||
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ def perform_m_search(local_ip):
|
||||||
sock.settimeout(5)
|
sock.settimeout(5)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return sock.recv(2048)
|
return sock.recv(2048).decode("utf8")
|
||||||
except socket.error:
|
except socket.error:
|
||||||
raise UpnpError("No reply from IGD using {} as IP".format(local_ip))
|
raise UpnpError("No reply from IGD using {} as IP".format(local_ip))
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Reference in a new issue