a
    èÝEb¾  ã                   @   sæ   d Z ddlZddlZddlZddlmZmZ ddl	m
Z
 ddl	mZ ddlmZ ddlmZmZmZmZmZmZmZ e d	e¡ g d
¢ZG dd„ deƒZeZeZeZejZej Z e!Z!e"Z"e# Z#Z$e%Z&eZ'e(Z(eZ)dd„ Z*ddd„Z+dS )z"Python 2/3 compat layer leftovers.é    N)Úredirect_stderrÚredirect_stdout)ÚBytesIO)ÚStringIO)ÚSimpleNamespaceé   )ÚTagÚbytechrÚbyteordÚ	bytesjoinÚstrjoinÚtobytesÚtostrzeThe py23 module has been deprecated and will be removed in a future release. Please update your code.)Ú
basestringr	   r
   r   r   ÚopenÚ	Py23ErrorÚrangeÚRecursionErrorÚroundr   r   r   r   r   r   Ú	tounicodeÚunichrÚunicodeÚ	UnicodeIOÚxrangeÚzipc                   @   s   e Zd ZdS )r   N)Ú__name__Ú
__module__Ú__qualname__© r   r   úS/home/ja/django-apps/lartica_env/lib/python3.9/site-packages/fontTools/misc/py23.pyr   -   s   r   c                  O   s   t dƒ‚d S )Nz-'xrange' is not defined. Use 'range' instead.)r   )ÚargsÚkwargsr   r   r   r   A   s    r   c                 C   sˆ   |du rd}|dk rTd|  }t | |ƒ\}}||d krH| dkrH|d7 }t|| ƒS t d¡|  }tj | ¡j|tjd�}t|ƒS dS )aØ  
    Implementation of Python 2 built-in round() function.
    Rounds a number to a given precision in decimal digits (default
    0 digits). The result is a floating point number. Values are rounded
    to the closest multiple of 10 to the power minus ndigits; if two
    multiples are equally close, rounding is done away from 0.
    ndigits may be negative.
    See Python 2 documentation:
    https://docs.python.org/2/library/functions.html?highlight=round#round
    Nr   é
   é   r   Ú10)Úrounding)ÚdivmodÚfloatÚ_decimalÚDecimalÚ
from_floatÚquantizeÚROUND_HALF_UP)ÚnumberÚndigitsÚexponentZquotientÚ	remainderÚdr   r   r   Úround2E   s    
ÿr2   )N),Ú__doc__Údecimalr(   ÚmathZ_mathÚwarningsÚ
contextlibr   r   Úior   r   r   Útypesr   Z	textToolsr   r	   r
   r   r   r   r   ÚwarnÚDeprecationWarningÚ__all__ÚNotImplementedErrorr   r   Ústrr   ÚiscloseÚisfiniter   r   r   Zround3Úchrr   r   r   r   r   r2   r   r   r   r   Ú<module>   s8   $ý