diff options
author | Thomas Kluyver <takowl@gmail.com> | 2019-01-16 12:44:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-16 12:44:26 +0100 |
commit | bbe53ac267b7378f0f400d3c49553625aab0f351 (patch) | |
tree | ffea7d0e35ac21569e7dc014b13e5bcd9f5f589a | |
parent | 831052254a039531adc91ebfce945d9ca54fd00a (diff) | |
parent | fb077dcdfaadf605b22bd295fb541b790ed7df87 (diff) | |
download | pexpect-bbe53ac267b7378f0f400d3c49553625aab0f351.tar.gz |
Merge pull request #551 from gsauthof/fix-logfile-example
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 ---------- |