o
    üN i0  ã                   @   s(   d dl Z d dlmZ dd„ Zdd„ ZdS )é    N)Ú
exceptionsc                   C   s   t jdkr
t d¡‚dS )a1  Check if the C-accelerated version of google-crc32c is available.

    If not, raise an error to prevent silent performance degradation.

    raises google.api_core.exceptions.FailedPrecondition: If the C extension is not available.
    returns: True if the C extension is available.
    rtype: bool

    ÚczºThe google-crc32c package is not installed with C support. C extension is required for faster data integrity checks.For more information, see https://github.com/googleapis/python-crc32c.N)Úgoogle_crc32cÚimplementationr   ÚFailedPrecondition© r   r   úW/home/ubuntu/.local/lib/python3.10/site-packages/google/cloud/storage/asyncio/_utils.pyÚraise_if_no_fast_crc32c   s
   

ÿÿr	   c                 C   s(   t |dƒr|jdur|j| _dS dS dS )zLUpdate the write_handle attribute of an object if it exists in the response.Úwrite_handleN)Úhasattrr
   )ÚobjÚresponser   r   r   Úupdate_write_handle_if_exists&   s   ÿr   )r   Úgoogle.api_corer   r	   r   r   r   r   r   Ú<module>   s   