[FIX] bus: websocket module import

The websocket client library  is used during tests but is not in
requirements.txt.  Therefore, imports are usually wrap into a try/except.
An import present in `websocket_rate_limiting` is not wrapped leading to
errors for those who have not the library installed. This PR fixes this
issue by wrapping this import in a try/except block.

closes odoo/odoo#98763

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
tsm-odoo
2022-08-25 03:11:48 +02:00
parent f00df383ea
commit ae97357675
@@ -2,7 +2,11 @@
import json
import time
from websocket._exceptions import WebSocketProtocolException
try:
from websocket._exceptions import WebSocketProtocolException
except ImportError:
pass
from odoo.tests import common
from .common import WebsocketCase