code: def ensure_file_is_executable(path):
      
      if platform.system() != 'Windows' and (
              not stat.S_IXUSR & os.stat(path)[stat.ST_MODE]):
          print("Error: File %s is not executable" % path)
          sys.exit(1)
docs: Exit if file is not executable.