diff options
| author | Catherine Devlin <catherine.devlin@gmail.com> | 2009-03-30 14:33:11 -0400 |
|---|---|---|
| committer | Catherine Devlin <catherine.devlin@gmail.com> | 2009-03-30 14:33:11 -0400 |
| commit | 91292dffca774f63945c36adecab3c6432838e22 (patch) | |
| tree | 82b80d2b15797f5dbb5e3faddc42c4e674e0f4c2 | |
| parent | d48fa6f4fb2f1ca684a0c2feba7103c512d6bd3f (diff) | |
| download | cmd2-git-0.5.1.tar.gz | |
transcript tests work0.5.1
| -rwxr-xr-x | cmd2.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -635,9 +635,13 @@ class Cmd(cmd.Cmd): self.lastcmd = statement.parsed.expanded funcname = self.func_named(statement.parsed.command) if not funcname: - return self.postparsing_postcmd(self.default(statement)) + return self.postparsing_postcmd(self.default(statement)) + try: + func = getattr(self, funcname) + except AttributeError: + return self.postparsing_postcmd(self.default(statement)) timestart = datetime.datetime.now() - stop = getattr(self, funcname)(statement) + stop = func(statement) if self.timing: print 'Elapsed: %s' % str(datetime.datetime.now() - timestart) except Exception, e: |
