3
Êb_Û  ã               @   s¦   d Z ddlZddlZddlZddlZejdkZejdkZejƒ dkZ	dd„ Z
ed	œd
d„Zed	œdd„Zed	œdd„Zed	œdd„Zed	œdd„Zdd„ Zdd„ ZdS )zn
compat
======

Cross-compatible functions for different versions of Python.

Other items:
* platform checker
é    Né   é   é   ÚPyPyc             C   s$   || _ |j › d|› �| _|j| _| S )z<
    Bind the name/qualname attributes of the function.
    Ú.)Ú__name__Ú__qualname__Ú
__module__)ÚfÚnameÚcls© r   ú8/tmp/pip-build-jkwsxyiy/pandas/pandas/compat/__init__.pyÚset_function_name   s    r   )Úreturnc               C   s
   t jdkS )z•
    Checking if the running platform is little endian.

    Returns
    -------
    bool
        True if the running platform is little endian.
    Úlittle)ÚsysÚ	byteorderr   r   r   r   Úis_platform_little_endian'   s    	r   c               C   s   t jdkpt jdkS )z‰
    Checking if the running platform is windows.

    Returns
    -------
    bool
        True if the running platform is windows.
    Úwin32Úcygwin)r   Úplatformr   r   r   r   Úis_platform_windows3   s    	r   c               C   s
   t jdkS )z…
    Checking if the running platform is linux.

    Returns
    -------
    bool
        True if the running platform is linux.
    Zlinux2)r   r   r   r   r   r   Úis_platform_linux?   s    	r   c               C   s
   t jdkS )z�
    Checking if the running platform is mac.

    Returns
    -------
    bool
        True if the running platform is mac.
    Údarwin)r   r   r   r   r   r   Úis_platform_macK   s    	r   c               C   s   t jdƒd dk S )z‡
    Checking if the running platform is 32-bit.

    Returns
    -------
    bool
        True if the running platform is 32-bit.
    ÚPr   é@   )ÚstructÚcalcsizer   r   r   r   Úis_platform_32bitW   s    	r    c              C   s4   yddl } | S  tk
r.   d}tj|ƒ Y nX dS )zh
    Importing the `lzma` module.

    Warns
    -----
    When the `lzma` module is not available.
    r   NzˆCould not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.)ÚlzmaÚImportErrorÚwarningsÚwarn)r!   Úmsgr   r   r   Ú_import_lzmac   s    r&   c             C   s   | dkrt dƒ‚| jS )a
  
    Importing the `LZMAFile` class from the `lzma` module.

    Returns
    -------
    class
        The `LZMAFile` class from the `lzma` module.

    Raises
    ------
    RuntimeError
        If the `lzma` module was not imported correctly, or didn't exist.
    Nzslzma module not available. A Python re-install with the proper dependencies, might be required to solve this issue.)ÚRuntimeErrorÚLZMAFile)r!   r   r   r   Ú_get_lzma_filex   s    r)   )r   r   )r   r   )Ú__doc__r   r   r   r#   Úversion_infoZPY37ZPY38Úpython_implementationZPYPYr   Úboolr   r   r   r   r    r&   r)   r   r   r   r   Ú<module>	   s   

