mirror of
https://github.com/9001/copyparty.git
synced 2026-02-26 13:33:09 -07:00
graalpy: workaround buggy inet_pton (#1282)
This commit is contained in:
parent
d692838095
commit
e8609b87af
|
|
@ -270,6 +270,20 @@ try:
|
|||
|
||||
socket.inet_pton(socket.AF_INET6, "::1")
|
||||
HAVE_IPV6 = True
|
||||
|
||||
if GRAAL:
|
||||
try:
|
||||
# --python.PosixModuleBackend=java throws OSError: illegal IP address
|
||||
socket.inet_pton(socket.AF_INET, "127.0.0.1")
|
||||
except:
|
||||
_inet_pton = socket.inet_pton
|
||||
|
||||
def inet_pton(fam, ip):
|
||||
if fam == socket.AF_INET:
|
||||
return socket.inet_aton(ip)
|
||||
return _inet_pton(fam, ip)
|
||||
|
||||
socket.inet_pton = inet_pton
|
||||
except:
|
||||
|
||||
def inet_pton(fam, ip):
|
||||
|
|
|
|||
Loading…
Reference in a new issue