File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 1111except ImportError : # pragma: no cover
1212 httpx = None # type: ignore
1313
14- import boto3
15- from botocore .auth import SigV4Auth
16- from botocore .awsrequest import AWSRequest
14+ try :
15+ import boto3
16+ from botocore .auth import SigV4Auth
17+ from botocore .awsrequest import AWSRequest
18+ except ImportError : # pragma: no cover
19+ boto3 = None # type: ignore
20+
1721
1822from .base import WebSocketBackend
1923from ..exceptions import WebSocketError , ConfigurationError
@@ -49,6 +53,9 @@ class WebSocket:
4953 api_gateway_region_name : Optional [str ] = None
5054
5155 def __post_init__ (self , dsn : Optional [str ]) -> None :
56+ if boto3 is None : # pragma: no cover
57+ raise WebSocketError ("boto3 must be installed to use WebSockets." )
58+
5259 if httpx is None : # pragma: no cover
5360 raise WebSocketError ("httpx must be installed to use WebSockets." )
5461
You can’t perform that action at this time.
0 commit comments