We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9956d8b commit fd1ed40Copy full SHA for fd1ed40
can/interfaces/udp_multicast/bus.py
@@ -14,16 +14,9 @@
14
15
from .utils import check_msgpack_installed, pack_message, unpack_message
16
17
-ioctl_supported = True
18
-
19
-try:
+is_linux = platform.system() == "Linux"
+if is_linux:
20
from fcntl import ioctl
21
-except ModuleNotFoundError: # Missing on Windows
22
- ioctl_supported = False
23
- pass
24
25
-# All ioctls aren't supported on MacOS.
26
-is_macos = platform.system() == "Darwin"
27
28
log = logging.getLogger(__name__)
29
@@ -408,7 +401,8 @@ def recv(
408
401
self.max_buffer
409
402
)
410
403
411
- if ioctl_supported and not is_macos:
404
+ if is_linux:
405
+ # This ioctl isn't supported on Darwin & Windows.
412
406
result_buffer = ioctl(
413
407
self._socket.fileno(),
414
SIOCGSTAMP,
0 commit comments