File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -130,11 +130,18 @@ class ICSOperationError(ICSApiError, CanOperationError):
130
130
131
131
132
132
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.
134
135
136
+ If the bus is not open, it raises a CanOperationError.
137
+ """
135
138
@functools .wraps (func )
136
139
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
+ """
138
145
if self ._is_shutdown :
139
146
raise CanOperationError ("Cannot operate on a closed bus" )
140
147
return func (self , * args , ** kwargs )
You can’t perform that action at this time.
0 commit comments