Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix newline handling in stdout and stderr #686
Merged
Conversation
bpython/curtsiesfrontend/repl.py
Outdated
| def send_to_stdout(self, output): | ||
| """Send unicode string to Repl stdout""" | ||
| if not output: return |
This comment has been minimized.
This comment has been minimized.
bpython/curtsiesfrontend/repl.py
Outdated
| @@ -1157,9 +1165,16 @@ def send_to_stderr(self, error): | |||
| Must be able to handle FmtStrs because interpreter pass in | |||
| tracebacks already formatted.""" | |||
| if not error: return | |||
This comment has been minimized.
This comment has been minimized.
bpython/curtsiesfrontend/repl.py
Outdated
| lines = output.split('\n') | ||
| if output == len(output) * '\n': | ||
| # If the string consist only of newline characters, | ||
| # str.split returns one more empty strings. |
This comment has been minimized.
This comment has been minimized.
sebastinas
May 28, 2017
Contributor
Since at this point split was already called, I'd feel that if all(len(line) == 0 for line in lines): would be nicer.
This comment has been minimized.
This comment has been minimized.
bpython/curtsiesfrontend/repl.py
Outdated
| if error == len(error) * '\n': | ||
| # If the string consist only of newline characters, | ||
| # str.split returns one more empty strings. | ||
| lines = lines[:-1] |
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
ata2001 commentedMay 27, 2017
Fixes #658.