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

Lines changed: 5 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy