Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backtrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,17 @@ def _extract_traceback(text):


def _stdin_hook(args):
output = sys.stdin.readlines()
if not sys.stdin.isatty():
output = sys.stdin.readlines()
else:
sys.exit(
'No input provided. Make sure you pipe stderr into '
'backtrace.')

if TRACEBACK_IDENTIFIER not in output:
sys.exit(
'No Traceback detected. Make sure you pipe stderr to '
'backtrace correctly.')
'backtrace.')

tb, all_else = _extract_traceback(output)
sys.stdout.write(''.join(all_else))
Expand Down