Skip to content

Commit

Permalink
Remove py3.9 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
hfern committed Jan 15, 2025
1 parent d7f9ce5 commit dc78076
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kombu/asynchronous/aws/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def __init__(self, sqs_connection, http_client=None,
**http_client_params)

def make_request(self, operation, params_, path, verb, callback=None, protocol_params=None):
params = params_.copy() | (protocol_params or {}).get('query', {})
params = params_.copy()
params.update((protocol_params or {}).get('query', {}))
if operation:
params['Action'] = operation
signer = self.sqs_connection._request_signer
Expand Down
2 changes: 1 addition & 1 deletion kombu/asynchronous/aws/sqs/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def make_request(self, operation_name, params, queue_url, verb, callback=None, p

service_model = self.sqs_connection.meta.service_model
protocol = service_model.protocol
all_params = (params or {}) | protocol_params.get(protocol, {})
all_params = {**(params or {}), **protocol_params.get(protocol, {})}

if protocol == 'query':
request = self._create_query_request(
Expand Down
4 changes: 2 additions & 2 deletions t/unit/asynchronous/aws/sqs/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def test_make_request__with_query_protocol(self):
queue_url = f'{SQS_URL}/123456789012/celery-test'
verb = 'POST'

expect_params = params | {'AttributeName.1': 'ApproximateReceiveCount'}
expect_params = {**params, 'AttributeName.1': 'ApproximateReceiveCount'}

self.x.make_request(operation, params, queue_url, verb, protocol_params=pparams)
self.x._create_query_request.assert_called_with(
Expand Down Expand Up @@ -186,7 +186,7 @@ def test_make_request__with_json_protocol(self):

queue_url = f'{SQS_URL}/123456789012/celery-test'
verb = 'POST'
expect_params = params | {'AttributeNames': ['ApproximateReceiveCount']}
expect_params = {**params, 'AttributeNames': ['ApproximateReceiveCount']}

self.x.make_request(operation, params, queue_url, verb, protocol_params=pparams)
self.x._create_json_request.assert_called_with(
Expand Down

0 comments on commit dc78076

Please sign in to comment.