Skip to content

Commit 030036c

Browse files
author
Steve Ayers
committed
Formatter
1 parent fd9330a commit 030036c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

protovalidate/internal/extra_func.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,12 @@ def is_email(string: celtypes.Value) -> celpy.Result:
166166
def is_uri(string: celtypes.Value) -> celpy.Result:
167167
url = urlparse.urlparse(string)
168168
# urlparse correctly reads the scheme from URNs but parses everything
169-
# after (except the query string) as the path.
169+
# after (except the query string) as the path.
170170
if url.scheme == "urn":
171171
if not (url.path):
172172
return celtypes.BoolType(False)
173-
else:
174-
if not all([url.scheme, url.netloc, url.path]):
175-
return celtypes.BoolType(False)
173+
elif not all([url.scheme, url.netloc, url.path]):
174+
return celtypes.BoolType(False)
176175

177176
# If the query string contains percent-encoding, then try to decode it.
178177
# unquote will return the same string if it is improperly encoded.

0 commit comments

Comments
 (0)