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 27b7c8b commit 8e45873Copy full SHA for 8e45873
serial/tools/list_ports_common.py
@@ -75,9 +75,13 @@ def apply_usb_info(self):
75
self.hwid = self.usb_info()
76
77
def __eq__(self, other):
78
- return self.device == other.device
+ return isinstance(other, ListPortInfo) and self.device == other.device
79
80
def __lt__(self, other):
81
+ if not isinstance(other, ListPortInfo):
82
+ raise TypeError('unorderable types: {}() and {}()'.format(
83
+ type(self).__name__,
84
+ type(other).__name__))
85
return numsplit(self.device) < numsplit(other.device)
86
87
def __str__(self):
0 commit comments