cpython: f889458c65cc (original) (raw)

Mercurial > cpython

changeset 74979:f889458c65cc 2.7

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:40:03 -0800
parents 3b127a415643
children d2b08b5896d9
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 = "I wish to buy a fish license.\n" @@ -193,8 +195,95 @@ class PtyTest(unittest.TestCase): # pty.fork() passed. + +class SmallPtyTests(unittest.TestCase):

+

+

+

+

+

+

+

+

+

+

+

+

+

+ + def test_main(verbose=None):

if name == "main": test_main()