code: def check_program_compression(archive, command, program, compression):
      
      program = os.path.basename(program)
      if compression:
          # check if compression is supported
          if not program_supports_compression(program, compression):
              if command == 'create':
                  comp_command = command
              else:
                  comp_command = 'extract'
              comp_prog = find_archive_program(compression, comp_command)
              if not comp_prog:
                  msg = "cannot %s archive `%s': compression `%s' not supported"
                  raise util.PatoolError(msg % (command, archive, compression))
docs: Check if a program supports the given compression.