1. SCons
  2. Core
  3. SCons


Tom Tanner  committed 1f3c683

Added stack dump on build error
Added message if nothing found to build
Always produce profile stats, no matter what sort of exit
Print message if you drop out with a build error

  • Participants
  • Parent commits 7af2258
  • Branches default

Comments (0)

Files changed (1)

File src/engine/SCons/Script/Main.py

View file
  • Ignore whitespace
                (EnvironmentError, SCons.Errors.StopError,
             type, value, trace = buildError.exc_info
+            if tb and print_stacktrace:
+                sys.stderr.write("scons: internal stack trace:\n")
+                traceback.print_tb(tb, file=sys.stderr)
             traceback.print_exception(type, value, trace)
         elif tb and print_stacktrace:
             sys.stderr.write("scons: internal stack trace:\n")
         # Build the targets
         nodes = _build_targets(fs, options, targets, target_top)
         if not nodes:
+            print 'Found nothing to build'
             exit_status = 2
 def _build_targets(fs, options, targets, target_top):
         prof = Profile()
             prof.runcall(_main, parser)
-        except SConsPrintHelpException, e:
+        finally:
-            raise e
-        except SystemExit:
-            pass
-        prof.dump_stats(options.profile_file)
         exit_status = 0
     except SCons.Errors.BuildError, e:
+        print e
         exit_status = e.exitstatus
         # An exception here is likely a builtin Python exception Python