summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-07-20 21:22:08 (GMT)
committerGuido van Rossum <guido@python.org>1998-07-20 21:22:08 (GMT)
commitc612681b20f2ff8786067a3d8c6d041bc64d0db0 (patch)
tree90fdc20bb357909be0615d2c189b2365de31ba95 /Lib
parentd623d20e7d624097e7c27365cc291bdf2538edc1 (diff)
downloadcpython-c612681b20f2ff8786067a3d8c6d041bc64d0db0.zip
cpython-c612681b20f2ff8786067a3d8c6d041bc64d0db0.tar.gz
cpython-c612681b20f2ff8786067a3d8c6d041bc64d0db0.tar.bz2
Fix another bug in ESR's changes. In order to work properly,
onecmd(line) must return the value returned by emptyline() or default(line).
Diffstat (limited to 'Lib')
-rw-r--r--Lib/cmd.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/cmd.py b/Lib/cmd.py
index 508c4de..35b9e0b 100644
--- a/Lib/cmd.py
+++ b/Lib/cmd.py
@@ -91,11 +91,9 @@ class Cmd:
if hasattr(self, 'do_shell'):
line = 'shell'
else:
- self.default(line)
- return
+ return self.default(line)
elif not line:
- self.emptyline()
- return
+ return self.emptyline()
self.lastcmd = line
i, n = 0, len(line)
while i < n and line[i] in self.identchars: i = i+1