Skip to content

Commit 484b1b6

Browse files
committed
Allow importing of ctypesutil on non-windows systems.
1 parent bc98e0a commit 484b1b6

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

can/ctypesutil.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ def map_symbol(self, func_name, restype=None, argtypes=(), errcheck=None):
4646
return symbol
4747

4848

49-
class CLibrary_Win32(ctypes.WinDLL, LibraryMixin):
49+
try:
50+
_LibBase = ctypes.WinDLL
51+
except AttributeError:
52+
_LibBase = ctypes.CDLL
53+
54+
class CLibrary_Win32(_LibBase, LibraryMixin):
5055
" Basic ctypes.WinDLL derived class + LibraryMixin "
5156

5257
def __init__(self, library_or_path):

doc/message.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,5 @@ Message
148148
The flags field is represented as a four-digit hexadecimal number. The arbitration
149149
ID field as either a four or eight digit hexadecimal number depending on the length
150150
of the arbitration ID (11-bit or 29-bit). Each of the bytes in the data field (when
151-
present) are represented as two-digit hexadecimal numbers. The following sections
152-
describe each of the parameters to the Message constructor.
153-
154-
155-
156-
157-
158-
151+
present) are represented as two-digit hexadecimal numbers.
159152

0 commit comments

Comments
 (0)