Skip to content

Commit f9c076c

Browse files
committed
mention segmentation faults on read() without select() in docs
1 parent 744c07e commit f9c076c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

evdev/device.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ def read(self):
204204
'''
205205
Read multiple input events from device. This function returns a
206206
generator object that yields :class:`InputEvent
207-
<evdev.events.InputEvent>` instances. '''
207+
<evdev.events.InputEvent>` instances.
208+
209+
.. warning:: Attempting to read from an input device that has no
210+
available data will result in a segmentation fault. Consider
211+
wrapping calls to ``read()`` in a ``select()``.
212+
'''
208213

209214
# events -> [(sec, usec, type, code, val), ...]
210215
events = _input.device_read_many(self.fd)

0 commit comments

Comments
 (0)