Skip to content

Commit 1ffa0c6

Browse files
authored
Avoid errors in select() calls in stdlib-samples. (#3055)
This make mypy's runtests.py pass again with HEAD typeshed. See python/typeshed#1080 (comment)
1 parent 5434979 commit 1ffa0c6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test-data/stdlib-samples/3.2/subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ def _communicate_with_select(self, input: Any) -> Tuple[List[bytes],
15831583
input_offset = 0
15841584
while read_set or write_set:
15851585
try:
1586-
rlist, wlist, xlist = select.select(read_set, write_set, [])
1586+
rlist, wlist, xlist = select.select(read_set, write_set, cast(List[object], []))
15871587
except select.error as e:
15881588
if e.args[0] == errno.EINTR:
15891589
continue

test-data/stdlib-samples/3.2/test/test_subprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ def kill_p2() -> None:
12911291
p1.stdin.write(data)
12921292
p1.stdin.close()
12931293

1294-
readfiles, ignored1, ignored2 = select.select([p2.stdout], [], [], 10)
1294+
readfiles, ignored1, ignored2 = select.select([p2.stdout], cast(List[object], []), cast(List[object], []), 10)
12951295

12961296
self.assertTrue(readfiles, "The child hung")
12971297
self.assertEqual(p2.stdout.read(), data)

0 commit comments

Comments
 (0)