Skip to content

Commit

Permalink
Remove useless path replacement in with_query (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Sep 8, 2024
1 parent 7e94253 commit ee90b00
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions yarl/_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,7 @@ def with_query(self, *args: Any, **kwargs: Any) -> "URL":
# N.B. doesn't cleanup query/fragment

new_query = self._get_str_query(*args, **kwargs) or ""
return URL(
self._val._replace(path=self._val.path, query=new_query), encoded=True
)
return URL(self._val._replace(query=new_query), encoded=True)

@overload
def update_query(self, query: Query) -> "URL": ...
Expand Down

0 comments on commit ee90b00

Please sign in to comment.