mirror of
https://github.com/python/cpython.git
synced 2025-10-02 05:12:23 +00:00
[3.7] bpo-32262: Fix typo in f-string (GH-7016)
Fix typo from commit6370f345e1
(cherry picked from commitd361e99868
) Co-authored-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
073eca39a5
commit
b85115ed4c
2 changed files with 25 additions and 1 deletions
|
@ -57,7 +57,7 @@ class BaseSubprocessTransport(transports.SubprocessTransport):
|
|||
if self._closed:
|
||||
info.append('closed')
|
||||
if self._pid is not None:
|
||||
info.append(f'pid={self.pid}')
|
||||
info.append(f'pid={self._pid}')
|
||||
if self._returncode is not None:
|
||||
info.append(f'returncode={self._returncode}')
|
||||
elif self._pid is not None:
|
||||
|
|
|
@ -29,6 +29,7 @@ class TestSubprocessTransport(base_subprocess.BaseSubprocessTransport):
|
|||
self._proc.stdin = None
|
||||
self._proc.stdout = None
|
||||
self._proc.stderr = None
|
||||
self._proc.pid = -1
|
||||
|
||||
|
||||
class SubprocessTransportTests(test_utils.TestCase):
|
||||
|
@ -73,6 +74,29 @@ class SubprocessTransportTests(test_utils.TestCase):
|
|||
|
||||
transport.close()
|
||||
|
||||
def test_subprocess_repr(self):
|
||||
waiter = asyncio.Future(loop=self.loop)
|
||||
transport, protocol = self.create_transport(waiter)
|
||||
transport._process_exited(6)
|
||||
self.loop.run_until_complete(waiter)
|
||||
|
||||
self.assertEqual(
|
||||
repr(transport),
|
||||
"<TestSubprocessTransport pid=-1 returncode=6>"
|
||||
)
|
||||
transport._returncode = None
|
||||
self.assertEqual(
|
||||
repr(transport),
|
||||
"<TestSubprocessTransport pid=-1 running>"
|
||||
)
|
||||
transport._pid = None
|
||||
transport._returncode = None
|
||||
self.assertEqual(
|
||||
repr(transport),
|
||||
"<TestSubprocessTransport not started>"
|
||||
)
|
||||
transport.close()
|
||||
|
||||
|
||||
class SubprocessMixin:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue