o
    §Ü€cš  ã                   @   sˆ   d dl Z d dlZd dlZd dlZd dlZd dlmZ ej d¡r%dd„ Z	nej
Z	dd„ ZeZdZdd	„ Zd
d„ Zdd„ Zd dlmZ dS )é    N)ÚsixÚwinc              
   C   sR   zt  |¡ W n ty  } z|jtjks‚ W Y d }~nd }~ww t  | |¡ d S )N)ÚosÚremoveÚOSErrorÚerrnoÚENOENTÚrename)Úcurrent_filenameÚnew_filenameÚe© r   ú</usr/local/lib/python3.10/dist-packages/s3transfer/compat.pyÚrename_file   s   û€ÿr   c                 C   s   t  | ¡d S )Né   )ÚinspectÚgetfullargspec)Úfuncr   r   r   Úaccepts_kwargs%   s   r   c                 C   sR   t | dƒr	|  ¡ S t | dƒr't | dƒr'z	|  dd¡ W dS  ty&   Y dS w dS )z»Backwards compat function to determine if a fileobj is seekable

    :param fileobj: The file-like object to determine if seekable

    :returns: True, if seekable. False, otherwise.
    ÚseekableÚseekÚtellr   é   TF)Úhasattrr   r   r   ©Úfileobjr   r   r   r   1   s   
	þr   c                 C   s   t | dƒr	|  ¡ S t | dƒS )z´Determines whether or not a file-like object is readable.

    :param fileobj: The file-like object to determine if readable

    :returns: True, if readable. False otherwise.
    ÚreadableÚread)r   r   r   r   r   r   r   I   s   

r   c                 C   s.   t tdƒrt |  ¡ d|¡ d S |  |¡ d S )NÚposix_fallocater   )r   r   r   ÚfilenoÚtruncate)r   Úsizer   r   r   Ú	fallocateV   s   
r"   )ÚBaseManager)r   r   r   ÚsocketÚsysÚbotocore.compatr   ÚplatformÚ
startswithr   r	   r   ÚConnectionErrorÚSOCKET_ERRORÚMAXINTr   r   r"   Úmultiprocessing.managersr#   r   r   r   r   Ú<module>   s    
