code: def find_deepest_user_frame(tb):
      
  
      tb.reverse()
  
      # find the deepest traceback frame that is not part
      # of SCons:
      for frame in tb:
          filename = frame[0]
          if filename.find(os.sep+'SCons'+os.sep) == -1:
              return frame
      return tb[0]
docs: Find the deepest stack frame that is not part of SCons.
  
      Input is a "pre-processed" stack trace in the form
      returned by traceback.extract_tb() or traceback.extract_stack()