summaryrefslogtreecommitdiffstats
path: root/Doc/library/cmd.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/library/cmd.rst')
-rw-r--r--Doc/library/cmd.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst
index 943c04a..9722928 100644
--- a/Doc/library/cmd.rst
+++ b/Doc/library/cmd.rst
@@ -285,8 +285,8 @@ immediate playback::
def do_playback(self, arg):
'Playback commands from a file: PLAYBACK rose.cmd'
self.close()
- cmds = open(arg).read().splitlines()
- self.cmdqueue.extend(cmds)
+ with open(arg) as f:
+ self.cmdqueue.extend(f.read().splitlines())
def precmd(self, line):
line = line.lower()
if self.file and 'playback' not in line: