diff options
author | Georg Sauthoff <mail@georg.so> | 2019-01-16 12:08:06 +0100 |
---|---|---|
committer | Georg Sauthoff <mail@georg.so> | 2019-01-16 12:08:06 +0100 |
commit | fb077dcdfaadf605b22bd295fb541b790ed7df87 (patch) | |
tree | ffea7d0e35ac21569e7dc014b13e5bcd9f5f589a | |
parent | 831052254a039531adc91ebfce945d9ca54fd00a (diff) | |
download | pexpect-git-fb077dcdfaadf605b22bd295fb541b790ed7df87.tar.gz |
Fix logfile example for Python 3
-rw-r--r-- | doc/overview.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/overview.rst b/doc/overview.rst index e52809c..aeb8887 100644 --- a/doc/overview.rst +++ b/doc/overview.rst @@ -207,7 +207,10 @@ It is also useful to log the child's input and out to a file or the screen. The following will turn on logging and send output to stdout (the screen):: child = pexpect.spawn(foo) - child.logfile = sys.stdout + child.logfile = sys.stdout.buffer + +The `sys.stdout.buffer` object is available since Python 3. With Python 2, one +has to assign just `sys.stdout` instead. Exceptions ---------- |