Skip to content

Commit f95869c

Browse files
author
sezanzeb
authored
threaded non-blocking close
1 parent 00c0fa7 commit f95869c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎evdev/device.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import warnings
55
import contextlib
66
import collections
7+
import threading
78

89
from evdev import _input, ecodes, util
910
from evdev.events import InputEvent
@@ -302,7 +303,7 @@ def close(self):
302303
if self.fd > -1:
303304
try:
304305
super().close()
305-
os.close(self.fd)
306+
threading.Thread(target=os.close, args=(self.fd,)).start()
306307
finally:
307308
self.fd = -1
308309

0 commit comments

Comments
 (0)