Skip to content

Commit

Permalink
Fix _print_message assertion.
Browse files Browse the repository at this point in the history
  • Loading branch information
mayfield committed Apr 5, 2017
1 parent 1c3abbf commit 01dd4a9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions shellish/command/supplement.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,13 @@ def print_help(self, *args, **kwargs):
return super().print_help(*args, **kwargs)

def _print_message(self, message, file=None):
assert isinstance(message, VTMLBuffer)
if not message:
return
if file is None:
file = sys.stdout
if not file.isatty():
file = sys.stderr
if isinstance(message, VTMLBuffer) and not file.isatty():
message = message.plain()
print(message, end='', file=file)
file.write(str(message))

def add_argument(self, *args, help=HELP_SENTINEL, **kwargs):
return super().add_argument(*args, help=help, **kwargs)
Expand Down

0 comments on commit 01dd4a9

Please sign in to comment.