GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — A better fix for asyncio test_stdin_broken_pipe (#7221) · python/cpython@ad74d50

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • Lib/test/test_asyncio
    • test_subprocess.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Lib/test/test_asyncio/test_subprocess.py‎

Copy file name to clipboardExpand all lines: Lib/test/test_asyncio/test_subprocess.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ def prepare_broken_pipe_test(self):
218218

219219
# the program ends before the stdin can be feeded
220220
create = asyncio.create_subprocess_exec(
221-
sys.executable, '-c', 'pass',
221+
sys.executable,
222+
'-c', 'print("hello", flush=True)',
222223
stdin=subprocess.PIPE,
224+
stdout=subprocess.PIPE,
223225
loop=self.loop)
224226
proc = self.loop.run_until_complete(create)
225227
return (proc, large_data)
@@ -228,7 +230,7 @@ def test_stdin_broken_pipe(self):
228230
proc, large_data = self.prepare_broken_pipe_test()
229231

230232
async def write_stdin(proc, data):
231-
await asyncio.sleep(0.5, loop=self.loop)
233+
await proc.stdout.readline()
232234
proc.stdin.write(data)
233235
await proc.stdin.drain()
234236

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.