o
    Àyð`€  ã                   @   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	ejr4dd„ ZeZdZn
dd„ ZejZej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   ú3/usr/lib/python3/dist-packages/s3transfer/compat.pyÚrename_file   s   û€ÿr   c                 C   ó   t  | ¡d S ©Né   )ÚinspectÚgetfullargspec©Úfuncr   r   r   Úaccepts_kwargs&   s   r   c                 C   r   r   )r   Ú
getargspecr   r   r   r   r   2   s   c              	   C   sV   t | dƒr	|  ¡ S t | dƒr)t | dƒr)z	|  dd¡ W dS  ttf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   ÚIOError©Úfileobjr   r   r   r   9   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!   Q   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   Ú	fallocate^   s   
r'   )ÚBaseManager)r   Úsysr   r   ÚsocketÚbotocore.compatr   ÚplatformÚ
startswithr   r	   ÚPY3r   ÚConnectionErrorÚSOCKET_ERRORÚMAXINTÚerrorÚmaxintr   r!   r'   Úmultiprocessing.managersr(   r   r   r   r   Ú<module>   s(   
	