pytty

changeset 22:6acf7684ee64 0.3

Updated TTY class example to work on both legacy Python and Python 3
author Arc Riley <arcriley@gmail.com>
date Tue, 13 Dec 2011 17:29:27 -0500
parents 39a1a84116a0
children b6f4ed45c537
files src/__init__.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/src/__init__.py	Tue Dec 13 17:16:12 2011 -0500
     1.2 +++ b/src/__init__.py	Tue Dec 13 17:29:27 2011 -0500
     1.3 @@ -44,11 +44,11 @@
     1.4          >>> ptys = os.openpty()  # create two connected ptys for testing
     1.5          >>> master = pytty.TTY(ptys[0])
     1.6          >>> slave = pytty.TTY(ptys[1])
     1.7 -        >>> slave.write('Greetings, Master.')
     1.8 -        18L
     1.9 +        >>> slave.write('Greetings, Master.'.encode()) == 18
    1.10 +        True
    1.11          >>> slave.flush()
    1.12 -        >>> master.read()
    1.13 -        'Greetings, Master.'
    1.14 +        >>> print(master.read().decode())
    1.15 +        Greetings, Master.
    1.16      '''
    1.17  
    1.18      # This is intended to be overridden by some subclasses