cpython: 994659efa292 (original) (raw)

Mercurial > cpython

changeset 74974:994659efa292 3.2

Issue #2489: Fix bug in _copy loop that could consume 100% cpu on EOF. [#2489]

Gregory P. Smith greg@krypto.org
date Thu, 16 Feb 2012 00:29:12 -0800
parents 824ddf6a30f2
children 72c8b54c1050
files Lib/pty.py Lib/test/test_pty.py
diffstat 2 files changed, 101 insertions(+), 6 deletions(-)[+] [-] Lib/pty.py 16 Lib/test/test_pty.py 91

line wrap: on

line diff

--- a/Lib/pty.py +++ b/Lib/pty.py @@ -142,15 +142,21 @@ def _copy(master_fd, master_read=_read, Copies pty master -> standard output (master_read) standard input -> pty master (stdin_read)"""

def spawn(argv, master_read=_read, stdin_read=_read): """Create a spawned process."""

--- a/Lib/test/test_pty.py +++ b/Lib/test/test_pty.py @@ -8,7 +8,9 @@ import errno import pty import os import sys +import select import signal +import socket import unittest TEST_STRING_1 = b"I wish to buy a fish license.\n" @@ -194,9 +196,96 @@ class PtyTest(unittest.TestCase): # pty.fork() passed. + +class SmallPtyTests(unittest.TestCase):

+

+

+

+

+

+

+

+

+

+

+

+

+

+ + def test_main(verbose=None): try: