)Ej dZddlZddlZddlZddlmZmZddl m Z ddl m Z ddl mZddlmZmZmZmZmZmZmZejd egd ZGd d eZeZe Z eZejZej Z e!Z!e"Z"e#xZ#Z$e%Z&eZ'e(Z(eZ)d Z*ddZ+dS)z"Python 2/3 compat layer leftovers.N)redirect_stderrredirect_stdout)BytesIO)StringIO)SimpleNamespace)Tagbytechrbyteord bytesjoinstrjointobytestostrzeThe py23 module has been deprecated and will be removed in a future release. Please update your code.) basestringr r rr open Py23ErrorrangeRecursionErrorroundrrr r rr tounicodeunichrunicode UnicodeIOxrangezipceZdZdS)rN)__name__ __module__ __qualname__EC:\PYTHON\MyICR_Suite\python\Lib\site-packages\fontTools/misc/py23.pyrr-sDr!rc td)Nz-'xrange' is not defined. Use 'range' instead.)r)argskwargss r"rrAs C D DDr!c^|d}|dkr?d| z}t||\}}||dzkr |dkr|dz }t||zStjd| z}tj||tj}t|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 r10)rounding)divmodfloat_decimalDecimal from_floatquantize ROUND_HALF_UP)numberndigitsexponentquotient remainderds r"round2r8Es{{7(#$VX66) A % %&A++ MHX()))#D))wh7   ' ' / / 8 8 x5 9  Qxxr!)N),__doc__decimalr-math_mathwarnings contextlibrriorrrtypesr textToolsr r r r r rrwarnDeprecationWarning__all__NotImplementedErrorrrstrriscloseisfiniterrrround3chrrrrrrr8r r!r"rKs((77777777$$$$$$!!!!!!PPPPPPPPPPPPPPPPPP      4     #       - >       EEEr!