Skip to content
Myr

Fixed a bug that caused random prints

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 1a54ca3 · Browse files · 2 files+9 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+9 added−8 removed

  • other:+9 added−8 removed

2 files+9 added−8 removed

modified:click/exceptions.py+1 added-1 removed
13 unmodified lines
14 self.message = message15 self.ctx = ctx161718class Abort(KeyboardInterrupt):18class Abort(RuntimeError):19 """An internal signalling exception that signals click to abort."""
modified:click/helpers.py+8 added-7 removed
160 unmodified lines
161 :param file: the file to write to (defaults to ``stdout``)162 """163 if file is None:164 file = sys.stdout165 if message is not None:165 if not isinstance(message, string_types):166 message = text_type(message)167 if message:168 if PY2 and isinstance(message, text_type):169 encoding = get_best_encoding(file)170 message = message.encode(encoding, 'replace')171 file.write(message)166 if not isinstance(message, string_types):167 message = text_type(message)168 if message:169 if PY2 and isinstance(message, text_type):170 encoding = get_best_encoding(file)171 message = message.encode(encoding, 'replace')172 file.write(message)173 file.write('\n')174 file.flush()