Kaydet (Commit) 3a4586a9 authored tarafından Charles-François Natali's avatar Charles-François Natali

Issue #18923: Update subprocess to use the new selectors module.

üst 2ce6c44a
This diff is collapsed.
...@@ -11,6 +11,7 @@ import errno ...@@ -11,6 +11,7 @@ import errno
import tempfile import tempfile
import time import time
import re import re
import selectors
import sysconfig import sysconfig
import warnings import warnings
import select import select
...@@ -2179,15 +2180,16 @@ class CommandTests(unittest.TestCase): ...@@ -2179,15 +2180,16 @@ class CommandTests(unittest.TestCase):
os.rmdir(dir) os.rmdir(dir)
@unittest.skipUnless(getattr(subprocess, '_has_poll', False), @unittest.skipUnless(hasattr(selectors, 'PollSelector'),
"poll system call not supported") "Test needs selectors.PollSelector")
class ProcessTestCaseNoPoll(ProcessTestCase): class ProcessTestCaseNoPoll(ProcessTestCase):
def setUp(self): def setUp(self):
subprocess._has_poll = False self.orig_selector = subprocess._PopenSelector
subprocess._PopenSelector = selectors.SelectSelector
ProcessTestCase.setUp(self) ProcessTestCase.setUp(self)
def tearDown(self): def tearDown(self):
subprocess._has_poll = True subprocess._PopenSelector = self.orig_selector
ProcessTestCase.tearDown(self) ProcessTestCase.tearDown(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment