How to use the ptyprocess.ptyprocess._make_eof_intr function in ptyprocess

To help you get started, we’ve selected a few ptyprocess examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pexpect / pexpect / tests / test_ctrl_chars.py View on Github external
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

'''
from __future__ import print_function

import pexpect
import unittest
from . import PexpectTestCase
import time
import sys

from ptyprocess import ptyprocess
ptyprocess._make_eof_intr()

if sys.version_info[0] >= 3:
    def byte(i):
        return bytes([i])
else:
    byte = chr

class TestCtrlChars(PexpectTestCase.PexpectTestCase):
    def setUp(self):
        super(TestCtrlChars, self).setUp()
        self.getch_cmd = self.PYTHONBIN + ' getch.py'

    def test_control_chars(self):
        '''This tests that we can send all 256 8-bit characters to a child
        process.'''
        child = pexpect.spawn(self.getch_cmd, echo=False, timeout=5)