Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
The helper function already deals with None
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Apr 7, 2022
1 parent 25c9127 commit 00f22d7
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions synapse/http/matrixfederationclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,7 @@ def __attrs_post_init__(self) -> None:

destination_bytes = self.destination.encode("ascii")
path_bytes = self.path.encode("ascii")
if self.query:
query_bytes = encode_query_args(self.query)
else:
query_bytes = b""
query_bytes = encode_query_args(self.query)

# The object is frozen so we can pre-compute this.
uri = urllib.parse.urlunparse(
Expand Down Expand Up @@ -482,10 +479,7 @@ async def _send_request(
method_bytes = request.method.encode("ascii")
destination_bytes = request.destination.encode("ascii")
path_bytes = request.path.encode("ascii")
if request.query:
query_bytes = encode_query_args(request.query)
else:
query_bytes = b""
query_bytes = encode_query_args(request.query)

scope = start_active_span(
"outgoing-federation-request",
Expand Down

0 comments on commit 00f22d7

Please sign in to comment.