diff options
author | Charles-François Natali <cf.natali@gmail.com> | 2013-11-08 18:56:59 (GMT) |
---|---|---|
committer | Charles-François Natali <cf.natali@gmail.com> | 2013-11-08 18:56:59 (GMT) |
commit | 3a4586a9f97c997fbdb0de297ed75374015e69bf (patch) | |
tree | a65e4cc91d8ef3b15c25899c422cb2461c066707 /Lib/test/test_subprocess.py | |
parent | 2ce6c44ae4c1055092a8cfb31d8d804c9b6458f6 (diff) | |
download | cpython-3a4586a9f97c997fbdb0de297ed75374015e69bf.zip cpython-3a4586a9f97c997fbdb0de297ed75374015e69bf.tar.gz cpython-3a4586a9f97c997fbdb0de297ed75374015e69bf.tar.bz2 |
Issue #18923: Update subprocess to use the new selectors module.
Diffstat (limited to 'Lib/test/test_subprocess.py')
-rw-r--r-- | Lib/test/test_subprocess.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index cdcee9f..e12f593 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -11,6 +11,7 @@ import errno import tempfile import time import re +import selectors import sysconfig import warnings import select @@ -2179,15 +2180,16 @@ class CommandTests(unittest.TestCase): os.rmdir(dir) -@unittest.skipUnless(getattr(subprocess, '_has_poll', False), - "poll system call not supported") +@unittest.skipUnless(hasattr(selectors, 'PollSelector'), + "Test needs selectors.PollSelector") class ProcessTestCaseNoPoll(ProcessTestCase): def setUp(self): - subprocess._has_poll = False + self.orig_selector = subprocess._PopenSelector + subprocess._PopenSelector = selectors.SelectSelector ProcessTestCase.setUp(self) def tearDown(self): - subprocess._has_poll = True + subprocess._PopenSelector = self.orig_selector ProcessTestCase.tearDown(self) |