From: Guido van Rossum Date: Mon, 20 Jul 1998 21:22:08 +0000 (+0000) Subject: Fix another bug in ESR's changes. In order to work properly, X-Git-Tag: v1.5.2a1~284 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c612681b20f2ff8786067a3d8c6d041bc64d0db0;p=python Fix another bug in ESR's changes. In order to work properly, onecmd(line) must return the value returned by emptyline() or default(line). --- diff --git a/Lib/cmd.py b/Lib/cmd.py index 508c4dedf7..35b9e0b1fc 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