From 1ffa0c6a0164e653f95fab8cb99b51ff23f8ae72 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 24 Mar 2017 16:38:53 -0700 Subject: [PATCH] Avoid errors in select() calls in stdlib-samples. (#3055) This make mypy's runtests.py pass again with HEAD typeshed. See https://github.com/python/typeshed/pull/1080#issuecomment-289157170 --- test-data/stdlib-samples/3.2/subprocess.py | 2 +- test-data/stdlib-samples/3.2/test/test_subprocess.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test-data/stdlib-samples/3.2/subprocess.py b/test-data/stdlib-samples/3.2/subprocess.py index 63b80f38adf1..5f2ed29116be 100644 --- a/test-data/stdlib-samples/3.2/subprocess.py +++ b/test-data/stdlib-samples/3.2/subprocess.py @@ -1583,7 +1583,7 @@ def _communicate_with_select(self, input: Any) -> Tuple[List[bytes], input_offset = 0 while read_set or write_set: try: - rlist, wlist, xlist = select.select(read_set, write_set, []) + rlist, wlist, xlist = select.select(read_set, write_set, cast(List[object], [])) except select.error as e: if e.args[0] == errno.EINTR: continue diff --git a/test-data/stdlib-samples/3.2/test/test_subprocess.py b/test-data/stdlib-samples/3.2/test/test_subprocess.py index 772d8cc416e4..d0d5ebe9d8e9 100644 --- a/test-data/stdlib-samples/3.2/test/test_subprocess.py +++ b/test-data/stdlib-samples/3.2/test/test_subprocess.py @@ -1291,7 +1291,7 @@ def kill_p2() -> None: p1.stdin.write(data) p1.stdin.close() - readfiles, ignored1, ignored2 = select.select([p2.stdout], [], [], 10) + readfiles, ignored1, ignored2 = select.select([p2.stdout], cast(List[object], []), cast(List[object], []), 10) self.assertTrue(readfiles, "The child hung") self.assertEqual(p2.stdout.read(), data)