Skip to content

Commit fd2eb24

Browse files
authored
Update neovi_bus.py
Improving docstring
1 parent f45d53f commit fd2eb24

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

can/interfaces/ics_neovi/neovi_bus.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,18 @@ class ICSOperationError(ICSApiError, CanOperationError):
130130

131131

132132
def check_if_bus_open(func):
133-
"""Decorator that raises :exc:`~can.exceptions.CanOperationError` if the bus is not open."""
133+
"""
134+
Decorator that checks if the bus is open before executing the function.
134135
136+
If the bus is not open, it raises a CanOperationError.
137+
"""
135138
@functools.wraps(func)
136139
def wrapper(self, *args, **kwargs):
137-
"""Raises :exc:`~can.exceptions.CanOperationError` if the bus is not open, else calls the wrapped function."""
140+
"""
141+
Wrapper function that checks if the bus is open before executing the function.
142+
143+
:raises CanOperationError: If the bus is not open.
144+
"""
138145
if self._is_shutdown:
139146
raise CanOperationError("Cannot operate on a closed bus")
140147
return func(self, *args, **kwargs)

0 commit comments

Comments
 (0)