code: def get_calling_namespaces():
      
      try: 1//0
      except ZeroDivisionError:
          # Don't start iterating with the current stack-frame to
          # prevent creating reference cycles (f_back is safe).
          frame = sys.exc_info()[2].tb_frame.f_back
  
      # Find the first frame that *isn't* from this file.  This means
      # that we expect all of the SCons frames that implement an Export()
      # or SConscript() call to be in this file, so that we can identify
      # the first non-Script.SConscript frame as the user's local calling
      # environment, and the locals and globals dictionaries from that
      # frame as the calling namespaces.  See the comment below preceding
      # the DefaultEnvironmentCall block for even more explanation.
      while frame.f_globals.get("__name__") == __name__:
          frame = frame.f_back
  
      return frame.f_locals, frame.f_globals
docs: Return the locals and globals for the function that called
      into this module in the current call stack.