Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b29e26a

Browse files
authored
select.poll is not available on windows (#13243)
1 parent a581069 commit b29e26a

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

stdlib/@tests/stubtest_allowlists/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ http.client.HTTPConnection.response_class # the actual type at runtime is abc.A
1616
importlib.abc.Loader.exec_module # See Lib/importlib/_abc.py. Might be defined for backwards compatibility
1717
importlib.abc.MetaPathFinder.find_spec # Not defined on the actual class, but expected to exist.
1818
importlib.abc.PathEntryFinder.find_spec # Not defined on the actual class, but expected to exist.
19-
select.poll # Depends on configuration
2019
socketserver.BaseServer.fileno # implemented in derived classes
2120
socketserver.BaseServer.get_request # implemented in derived classes
2221
socketserver.BaseServer.server_bind # implemented in derived classes

stdlib/@tests/stubtest_allowlists/darwin.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ curses.has_key # stubtest gets confused because this is both a module and a fun
4444
multiprocessing.popen_spawn_win32 # exists on Darwin but fails to import
4545
readline.append_history_file # Only available if compiled with GNU readline, not editline
4646
select.kqueue.__init__ # default C signature is wrong
47+
select.poll # Actually a function; we have a class so it can be used as a type
4748

4849
# Some of these exist on non-windows, but they are useless and this is not intended
4950
stat.FILE_ATTRIBUTE_[A-Z_]+

stdlib/@tests/stubtest_allowlists/linux.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ curses.LINES # Initialized only after initscr call
2525
curses.has_key # stubtest gets confused because this is both a module and a function in curses
2626
fcntl.I_[A-Z0-9_]+ # Platform differences that cannot be captured by the type system
2727
multiprocessing.popen_spawn_win32 # exists on Linux but fails to import
28+
select.poll # Actually a function; we have a class so it can be used as a type
2829

2930
# These seem like they should be available on Linux, but they're not
3031
# on GitHub Actions runners for some reason.

stdlib/select.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,14 @@ if sys.platform != "win32":
2222
POLLWRBAND: int
2323
POLLWRNORM: int
2424

25-
class poll:
26-
def register(self, fd: FileDescriptorLike, eventmask: int = ...) -> None: ...
27-
def modify(self, fd: FileDescriptorLike, eventmask: int) -> None: ...
28-
def unregister(self, fd: FileDescriptorLike) -> None: ...
29-
def poll(self, timeout: float | None = ...) -> list[tuple[int, int]]: ...
25+
# This is actually a function that returns an instance of a class.
26+
# The class is not accessible directly, and also calls itself select.poll.
27+
class poll:
28+
# default value is select.POLLIN | select.POLLPRI | select.POLLOUT
29+
def register(self, fd: FileDescriptorLike, eventmask: int = 7, /) -> None: ...
30+
def modify(self, fd: FileDescriptorLike, eventmask: int, /) -> None: ...
31+
def unregister(self, fd: FileDescriptorLike, /) -> None: ...
32+
def poll(self, timeout: float | None = None, /) -> list[tuple[int, int]]: ...
3033

3134
def select(
3235
rlist: Iterable[Any], wlist: Iterable[Any], xlist: Iterable[Any], timeout: float | None = None, /

0 commit comments

Comments
 (0)