Skip to content

Commit 84f3cbb

Browse files
committed
select: Add epoll.unregister() method.
1 parent 808b492 commit 84f3cbb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

select/select.py

+5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ def register(self, fd, eventmask=EPOLLIN|EPOLLPRI|EPOLLOUT, retval=None):
4242
r = epoll_ctl(self.epfd, EPOLL_CTL_MOD, fd, s)
4343
os.check_error(r)
4444

45+
def unregister(self, fd):
46+
# Pass dummy event structure, to workaround kernel bug
47+
r = epoll_ctl(self.epfd, EPOLL_CTL_DEL, fd, self.evbuf)
48+
os.check_error(r)
49+
4550
def poll(self, timeout=-1):
4651
s = bytearray(self.evbuf)
4752
n = epoll_wait(self.epfd, s, 1, timeout)

select/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from setuptools import setup
66

77
setup(name='micropython-select',
8-
version='0.0.2',
8+
version='0.0.3',
99
description='select module to MicroPython',
1010
url='https://github.com/micropython/micropython/issues/405',
1111
author='Paul Sokolovsky',

0 commit comments

Comments
 (0)