File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 88
99import logging
1010import struct
11+ import io
1112from time import time
1213from can import BusABC , Message
1314
@@ -262,7 +263,7 @@ def _recv_internal(self, timeout):
262263 return None , None
263264
264265 def fileno (self ):
265- if hasattr ( self . ser , "fileno" ) :
266+ try :
266267 return self .ser .fileno ()
267- # Return an invalid file descriptor on Windows
268- return - 1
268+ except io . UnsupportedOperation :
269+ raise NotImplementedError ( "fileno is not implemented using current CAN bus" )
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ def add_listener(self, listener: Listener):
158158
159159 def remove_listener (self , listener : Listener ):
160160 """Remove a listener from the notification list. This method
161- trows an exception if the given listener is not part of the
161+ throws an exception if the given listener is not part of the
162162 stored listeners.
163163
164164 :param listener: Listener to be removed from the list to be notified
You can’t perform that action at this time.
0 commit comments