Skip to content

Commit 648abb1

Browse files
committed
Remove unreachable defensive code to improve coverage
Removed the else branch handling when url is neither str nor URL, as the type hint enforces url: URL | str. This was unreachable defensive code that was causing a coverage gap.
1 parent a55dc58 commit 648abb1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

httpx/_urls.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,8 @@ def __init__(self, url: URL | str = "", **kwargs: typing.Any) -> None:
129129
if parsed_url.query
130130
else QueryParams()
131131
)
132-
elif isinstance(url, URL):
132+
else: # isinstance(url, URL)
133133
existing_params = url.params
134-
else:
135-
existing_params = QueryParams()
136134

137135
# Merge existing and new params
138136
if params:

0 commit comments

Comments
 (0)