Skip to content

Commit 2d1f691

Browse files
committed
Fix tests when sqs_extended_client is not installed
The try/except block was triggering when sqs_extended_client isn't installed, which results in boto being overwritten with None
1 parent e81d5da commit 2d1f691

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

kombu/asynchronous/aws/ext.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@
44

55
try:
66
import boto3
7-
import sqs_extended_client
87
from botocore import exceptions
98
from botocore.awsrequest import AWSRequest
109
from botocore.httpsession import get_cert_path
1110
from botocore.response import get_response
1211
except ImportError:
1312
boto3 = None
14-
sqs_extended_client = None
1513

1614
class _void:
1715
pass
@@ -24,6 +22,11 @@ class BotoCoreError(Exception):
2422
get_response = _void()
2523
get_cert_path = _void()
2624

25+
try:
26+
import sqs_extended_client
27+
except ImportError:
28+
sqs_extended_client = None
29+
2730

2831
__all__ = (
2932
'exceptions', 'AWSRequest', 'get_response', 'get_cert_path',

kombu/asynchronous/aws/sqs/ext.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
try:
77
import boto3
8-
import sqs_extended_client
98
except ImportError:
109
boto3 = None
10+
11+
try:
12+
import sqs_extended_client
13+
except ImportError:
1114
sqs_extended_client = None

0 commit comments

Comments
 (0)