summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Sauthoff <mail@georg.so>2019-01-16 12:08:06 +0100
committerGeorg Sauthoff <mail@georg.so>2019-01-16 12:08:06 +0100
commitfb077dcdfaadf605b22bd295fb541b790ed7df87 (patch)
treeffea7d0e35ac21569e7dc014b13e5bcd9f5f589a
parent831052254a039531adc91ebfce945d9ca54fd00a (diff)
downloadpexpect-git-fb077dcdfaadf605b22bd295fb541b790ed7df87.tar.gz
Fix logfile example for Python 3
-rw-r--r--doc/overview.rst5
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
----------