Skip to content

Commit 49bb2ba

Browse files
committed
Merge pull request gvalkov#41 from isia/master
Fixed comparing with other objects.
2 parents 15007c4 + 2a1d51b commit 49bb2ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎evdev/device.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def set_led(self, led_num, value):
233233

234234
def __eq__(self, other):
235235
'''Two devices are equal if their :data:`info` attributes are equal.'''
236-
return self.info == other.info
236+
return isinstance(other, InputDevice) and self.info == other.info
237237

238238
def __str__(self):
239239
msg = 'device {}, name "{}", phys "{}"'

0 commit comments

Comments
 (0)