Skip to content

Commit 23e5c17

Browse files
committed
libusb1: Use b-strings.
Removes one reason to have a version check here. This is supported since 2.6 .
1 parent ef35593 commit 23e5c17

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

usb1/libusb1.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,8 @@ def __str__(self):
142142

143143
if sys.version_info[0] == 3:
144144
_string_item_to_int = lambda x: x
145-
_empty_char_p = bytes()
146145
else:
147146
_string_item_to_int = ord
148-
_empty_char_p = ''
149147

150148
c_uchar = c_uint8
151149
c_int_p = POINTER(c_int)
@@ -737,7 +735,7 @@ class libusb_transfer(Structure):
737735
try:
738736
libusb_get_version = libusb.libusb_get_version
739737
except AttributeError:
740-
_dummy_version = libusb_version(0, 0, 0, 0, _empty_char_p, _empty_char_p)
738+
_dummy_version = libusb_version(0, 0, 0, 0, b'', b'')
741739
_dummy_version_p = pointer(_dummy_version)
742740
def libusb_get_version():
743741
return _dummy_version_p

0 commit comments

Comments
 (0)