Skip to content

Commit 4afaf82

Browse files
committed
clearify documentation
1 parent c6d770c commit 4afaf82

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

can/interfaces/virtual.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class VirtualBus(BusABC):
4141
:meth:`can.VirtualBus._detect_available_configs` for how it
4242
behaves here.
4343
44-
The timeout when sending a message applies to each receiver.
44+
.. note::
45+
The timeout when sending a message applies to each receiver
46+
individually. This means that sending can block up to 5 seconds
47+
if a message is sent to 5 receivers with the timeout set to 1.0.
4548
"""
4649

4750
def __init__(self, channel=None, receive_own_messages=False,
@@ -51,7 +54,7 @@ def __init__(self, channel=None, receive_own_messages=False,
5154

5255
# the channel identifier may be an arbitrary object
5356
self.channel_id = channel
54-
self.channel_info = 'Virtual bus channel %s' % self.channel_id
57+
self.channel_info = "Virtual bus channel {}".format(self.channel_id)
5558
self.receive_own_messages = receive_own_messages
5659
self._open = True
5760

@@ -71,7 +74,7 @@ def _check_if_open(self):
7174
Has to be called in every method that accesses the bus.
7275
"""
7376
if not self._open:
74-
raise CanError('Operation on closed bus')
77+
raise CanError("Operation on closed bus")
7578

7679
def _recv_internal(self, timeout):
7780
self._check_if_open()
@@ -98,7 +101,7 @@ def send(self, msg, timeout=None):
98101
except queue.Full:
99102
all_sent = False
100103
if not all_sent:
101-
raise CanError('Could not send message to one or more recipients')
104+
raise CanError("Could not send message to one or more recipients")
102105

103106
def shutdown(self):
104107
self._check_if_open()

0 commit comments

Comments
 (0)