Skip to content

Commit c085d40

Browse files
committed
raise UInputError on uinput.capabilities() if device couldn't be opened
1 parent 5f80cf2 commit c085d40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

evdev/uinput.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ def syn(self):
168168

169169
def capabilities(self, verbose=False, absinfo=True):
170170
'''See :func:`capabilities <evdev.device.InputDevice.capabilities>`.'''
171+
if self.device is None:
172+
raise UInputError('input device not opened - cannot read capabilites')
173+
171174
return self.device.capabilities(verbose, absinfo)
172175

173176
def _verify(self):

0 commit comments

Comments
 (0)