a
    w=ic                     @   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   d/home/droni/.local/share/virtualenvs/DPS-5Je3_V2c/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   $