summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Eargle <dave@daveeargle.com>2019-06-18 23:10:54 -0600
committerDave Eargle <dave@daveeargle.com>2019-06-18 23:10:54 -0600
commit2dd92793d935895de4682ea6e45b774528f9857f (patch)
treebaaa67fc0375b3a6677bdc9fcc46bf9053cf02e9
parent08259ea5a9b139db0c9c7bc5f5e2821b99843bb4 (diff)
downloadcmd2-git-python2.tar.gz
rely on already-imported String()python2
closes #694
-rwxr-xr-xcmd2.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd2.py b/cmd2.py
index 29a993f3..f6680221 100755
--- a/cmd2.py
+++ b/cmd2.py
@@ -3663,7 +3663,6 @@ a..b, a:b, a:, ..b items by indices (inclusive)
"""Generate a transcript file from a given history of commands."""
# Save the current echo state, and turn it off. We inject commands into the
# output using a different mechanism
- import io
saved_echo = self.echo
self.echo = False
@@ -3695,7 +3694,7 @@ a..b, a:b, a:, ..b items by indices (inclusive)
transcript += command
# create a new string buffer and set it to stdout to catch the output
# of the command
- membuf = io.StringIO()
+ membuf = StringIO()
self.stdout = membuf
# then run the command and let the output go into our buffer
self.onecmd_plus_hooks(history_item)