diff options
| author | Éric Araujo <merwok@netwok.org> | 2011-03-11 17:42:48 +0100 |
|---|---|---|
| committer | Éric Araujo <merwok@netwok.org> | 2011-03-11 17:42:48 +0100 |
| commit | a3dd56b6cffaeee21fec6529b212fd4fa98c1ea8 (patch) | |
| tree | 6b9fe78b2e36d78d159216950039a033ba9311a8 /Doc/library/cmd.rst | |
| parent | 17b880a5d6b64f1e7d26ec8229e8b41cdf740690 (diff) | |
| download | cpython-git-a3dd56b6cffaeee21fec6529b212fd4fa98c1ea8.tar.gz | |
Use with statement where it improves the documentation (closes #10461)
Diffstat (limited to 'Doc/library/cmd.rst')
| -rw-r--r-- | Doc/library/cmd.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/cmd.rst b/Doc/library/cmd.rst index 464764d793..b33d724618 100644 --- a/Doc/library/cmd.rst +++ b/Doc/library/cmd.rst @@ -282,8 +282,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: |
