diff --git a/src/marshmallow/validate.py b/src/marshmallow/validate.py index aa27136b2..47e106a5f 100644 --- a/src/marshmallow/validate.py +++ b/src/marshmallow/validate.py @@ -224,7 +224,10 @@ def __call__(self, value: str) -> str: # Extract the netloc (hostname and port) parsed_url = urlparse(value) hostname = parsed_url.hostname - except (ValueError, TypeError, ): + except ( + ValueError, + TypeError, + ): hostname = None if hostname: