3
���h6 � @ s� d Z ddlZddlZddlZddlZddlmZ ejdkZejdkZ ejdkZ
ej� dkZej
d kZeeed�dd
�Zed�dd�Zed�dd�Zed�dd�Zed�dd�Zed�dd�Zdd� Zdd� ZdS )!zn
compat
======
Cross-compatible functions for different versions of Python.
Other items:
* platform checker
� N)�F� � � � �PyPy� � )�f�name�returnc C s$ || _ |j � d|� �| _|j| _| S )z<
Bind the name/qualname attributes of the function.
�.)�__name__�__qualname__�
__module__)r
r �cls� r �8/tmp/pip-build-5_djhm0z/pandas/pandas/compat/__init__.py�set_function_name s r )r c C s
t jdkS )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 jdkpt jdkS )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_windows7 s r c C s
t jdkS )z�
Checking if the running platform is linux.
Returns
-------
bool
True if the running platform is linux.
Zlinux2)r r r r r r �is_platform_linuxC s r c C s
t jdkS )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_macO s r c C s t jd�d dk 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_32bit[ s r$ c C s4 yddl } | S tk
r. d}tj|� Y nX dS )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_lzmag s r* c C s | dkrt d��| jS )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_file{ s r- )r r )r r )r r l )�__doc__r r" |