File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -442,6 +442,9 @@ class Job:
442442 self .warning (
443443 "Session transcript and error messages are in %s."
444444 % self .log_filename )
445+ sys .stderr .write ("The relevant lines from the transcript are:\n " )
446+ sys .stderr .write ("-" * 72 + "\n " )
447+ sys .stderr .writelines (get_run_transcript (self .log_filename ))
445448 sys .exit (rc )
446449
447450 def message (self , msg ):
@@ -461,7 +464,23 @@ class Job:
461464 fp .close ()
462465
463466
467+ def get_run_transcript (filename ):
468+ """Return lines from the transcript file for the most recent run() call."""
469+ fp = open (filename )
470+ lines = fp .readlines ()
471+ fp .close ()
472+ lines .reverse ()
473+ L = []
474+ for line in lines :
475+ L .append (line )
476+ if line [:4 ] == "+++ " :
477+ break
478+ L .reverse ()
479+ return L
480+
481+
464482def safe_unlink (path ):
483+ """Unlink a file without raising an error if it doesn't exist."""
465484 try :
466485 os .unlink (path )
467486 except os .error :
You can’t perform that action at this time.
0 commit comments