We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ba2a93 commit 77c1737Copy full SHA for 77c1737
1 file changed
can/interfaces/seeedstudio/seeedstudio.py
@@ -8,6 +8,7 @@
8
9
import logging
10
import struct
11
+import io
12
from time import time
13
from can import BusABC, Message
14
@@ -262,7 +263,7 @@ def _recv_internal(self, timeout):
262
263
return None, None
264
265
def fileno(self):
- if hasattr(self.ser, "fileno"):
266
+ try:
267
return self.ser.fileno()
- # Return an invalid file descriptor on Windows
268
- return -1
+ except io.UnsupportedOperation:
269
+ raise NotImplementedError("fileno is not implemented using current CAN bus")
0 commit comments