mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
gh-133306: Use \z instead of \Z in regular expressions in the stdlib (GH-133337)
This commit is contained in:
parent
add0ca9ea0
commit
84a08f8629
16 changed files with 23 additions and 23 deletions
|
@ -460,7 +460,7 @@ def _check_bracketed_netloc(netloc):
|
|||
# https://www.rfc-editor.org/rfc/rfc3986#page-49 and https://url.spec.whatwg.org/
|
||||
def _check_bracketed_host(hostname):
|
||||
if hostname.startswith('v'):
|
||||
if not re.match(r"\Av[a-fA-F0-9]+\..+\Z", hostname):
|
||||
if not re.match(r"\Av[a-fA-F0-9]+\..+\z", hostname):
|
||||
raise ValueError(f"IPvFuture address is invalid")
|
||||
else:
|
||||
ip = ipaddress.ip_address(hostname) # Throws Value Error if not IPv6 or IPv4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue