diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-02-01 02:18:36 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-02-01 02:18:36 -0500 |
commit | adc36ff4f7debb526931e5fc04907483033dbf5b (patch) | |
tree | add012f6e6ef8476ae6d40825ee04a613c97541d /cmd2.py | |
parent | 303f82d24824b93967e30e439449c614acc7d4b7 (diff) | |
download | cmd2-git-adc36ff4f7debb526931e5fc04907483033dbf5b.tar.gz |
Fixed a bug that would occur if a pipe was entered on a line by itself
Diffstat (limited to 'cmd2.py')
-rwxr-xr-x | cmd2.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -826,7 +826,11 @@ class Cmd(cmd.Cmd): if s.lower().startswith(shortcut): s = s.replace(shortcut, expansion + ' ', 1) break - result = self.parser.parseString(s) + try: + result = self.parser.parseString(s) + except pyparsing.ParseException: + # If we have a parsing failure, treat it is an empty command and move to next prompt + result = self.parser.parseString('') result['raw'] = raw result['command'] = result.multilineCommand or result.command result = self.postparse(result) |