3
[_ð]ß  ã               @   sÄ   d dl Z d dlZd dlmZ e jd  dkZe jd  dkZerFeZeZ	neZe	Z	er†e
ZeZe
fZeZdd„ Zdd„ Zd	d
„ Zdd„ Zn2eZe
ZefZeZdd„ Zdd„ Zdd
„ Zdd„ Zdd„ ZdS )é    N)ÚContexté   é   c             C   s   | j ƒ S )N)Údecode)Úx© r   ú0/tmp/pip-build-yz_zf6az/dnspython/dns/_compat.pyÚmaybe_decode   s    r	   c             C   s   | j ƒ S )N)Úencode)r   r   r   r   Úmaybe_encode   s    r   c             C   s   | S )Nr   )r   r   r   r   Ú	maybe_chr   s    r   c             C   s   | S )Nr   )r   r   r   r   Ú	maybe_ord   s    r   c             C   s   | S )Nr   )r   r   r   r   r	   %   s    c             C   s   | S )Nr   )r   r   r   r   r   '   s    c             C   s   t | ƒS )N)Úchr)r   r   r   r   r   )   s    c             C   s   t | ƒS )N)Úord)r   r   r   r   r   +   s    c             C   s,   t ttt| ƒƒƒtjd�jt| ƒƒ}t|ƒS )zõ
    Python 2 and Python 3 use different rounding strategies in round(). This
    function ensures that results are python2/3 compatible and backward
    compatible with previous py2 releases
    :param what: float
    :return: rounded long
    )ÚprecÚrounding)r   ÚlenÚstrÚlongÚdecimalÚROUND_HALF_UPÚcreate_decimal)ÚwhatÚdr   r   r   Úround_py2_compat/   s
    

r   )Úsysr   r   Úversion_infoÚPY3ÚPY2Úintr   ÚrangeÚxranger   Ú	text_typeÚbytesÚbinary_typeÚstring_typesr   Úunichrr	   r   r   r   ÚunicodeÚ
basestringr   r   r   r   r   Ú<module>   s6   
