You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We got the continuation prompt - command was incomplete
I've been using this to wrap a python interpreter and have come across the issue that the run_command code doesn't distinguish between a hard continuation where a statement is missing a body e.g.
if true:
and a soft continuation where a statement could contain more in its body:
if true:
print("hi")
This results in the value error being raised each time a nested statement is used.
To solve the issue in Python the code can be modified to:
if self._expect_prompt(timeout=timeout) == 1:
# Try and resolve the continuation
self.sendline("")
if self._expect_prompt(timeout=timeout) == 1:
# We got the continuation prompt - command was incomplete
self.interrupt(continuation=True)
raise ValueError("Continuation prompt found - input was incomplete:\n" + command)
Perhaps this could be added as an option on the class?
The text was updated successfully, but these errors were encountered:
metakernel/metakernel/replwrap.py
Line 243 in 2de5d37
I've been using this to wrap a python interpreter and have come across the issue that the
run_command
code doesn't distinguish between a hard continuation where a statement is missing a body e.g.and a soft continuation where a statement could contain more in its body:
This results in the value error being raised each time a nested statement is used.
To solve the issue in Python the code can be modified to:
Perhaps this could be added as an option on the class?
The text was updated successfully, but these errors were encountered: