summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd2/parsing.py2
-rw-r--r--cmd2/pyscript_bridge.py3
2 files changed, 2 insertions, 3 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index 2dc698b0..2af8a207 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -372,7 +372,7 @@ class StatementParser:
line = self._expand(line)
# check if this line is a comment
- if line.strip().startswith(constants.COMMENT_CHAR):
+ if line.lstrip().startswith(constants.COMMENT_CHAR):
return []
# split on whitespace
diff --git a/cmd2/pyscript_bridge.py b/cmd2/pyscript_bridge.py
index e1568b7c..a4eaf308 100644
--- a/cmd2/pyscript_bridge.py
+++ b/cmd2/pyscript_bridge.py
@@ -98,8 +98,7 @@ class PyscriptBridge(object):
self._cmd2_app.stdout = copy_cmd_stdout
with redirect_stdout(copy_cmd_stdout):
with redirect_stderr(copy_stderr):
- # Include a newline in case it's a multiline command
- self._cmd2_app.onecmd_plus_hooks(command + '\n')
+ self._cmd2_app.onecmd_plus_hooks(command)
finally:
self._cmd2_app.stdout = copy_cmd_stdout.inner_stream