Skip to content

Commit a11ab2b

Browse files
committed
Cope with IPv6Address now allowing zone IDs in 3.9.
1 parent a439f30 commit a11ab2b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jsonschema/_format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def is_ipv4(instance):
199199
def is_ipv6(instance):
200200
if not isinstance(instance, str):
201201
return True
202-
return ipaddress.IPv6Address(instance)
202+
address = ipaddress.IPv6Address(instance)
203+
return not getattr(address, "scope_id", "")
203204

204205

205206
try:

0 commit comments

Comments
 (0)