def disable_threading_if_append_mode(config, fileobj):
    """Set `TransferConfig.use_threads` to `False` if file-like
        object is in append mode.

    :type config: boto3.s3.transfer.TransferConfig
    :param config: The transfer configuration to be used when performing the
        download.

    :type fileobj: A file-like object
    :param fileobj: A file-like object to inspect for append mode.
    """
    if is_append_mode(fileobj):
        config.use_threads = False
        logger.warning(
            'A single thread will be used because the provided file object '
            'is in append mode. Writes may always be appended to the end of '
            'the file regardless of seek position, so a single thread must be '
            'used to ensure sequential writes.'
        )
Set `TransferConfig.use_threads` to `False` if file-like
        object is in append mode.

    :type config: boto3.s3.transfer.TransferConfig
    :param config: The transfer configuration to be used when performing the
        download.

    :type fileobj: A file-like object
    :param fileobj: A file-like object to inspect for append mode.
    
boto3/s3/inject.py