mirror of
https://github.com/9001/copyparty.git
synced 2026-09-24 19:30:23 +01:00
graalpy: workaround buggy inet_pton (#1282)
This commit is contained in:
@@ -270,6 +270,20 @@ try:
|
|||||||
|
|
||||||
socket.inet_pton(socket.AF_INET6, "::1")
|
socket.inet_pton(socket.AF_INET6, "::1")
|
||||||
HAVE_IPV6 = True
|
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:
|
except:
|
||||||
|
|
||||||
def inet_pton(fam, ip):
|
def inet_pton(fam, ip):
|
||||||
|
|||||||
Reference in New Issue
Block a user