/
lib
/
python3.9
/
site-packages
/
ntp
/
__pycache__
/
New Directory
Upload File
HOME
a +��j5 � @ s� d Z ddlZdZdZeeu r>eZeZeZ e ZeZe Zdd� Zn�ddlZeZdd� ZeZd d � Z dd� Zd d� Zdd� Zdd� Zdejj�� kr�dZeej�e_dejj�� kr�dZeej�e_dS )a Handle bytes and strings in a polyglot fashion. copied from ../ntpclient/ntpq.py which got it from https://gitlab.com/esr/practical-python-porting/blob/master/polystr-inclusion.py see http://www.catb.org/esr/faqs/practical-python-porting/ for more information. � Nzlatin-1Fc C s | � d�S )zString_escape/unicode_escape.� string_escape)�decode��s� r �,/usr/lib/python3.9/site-packages/ntp/poly.pyr 0 s r c C s, t | t�r| S t | t�s t| �S t| td�S )z$Polymorphic string factory function.��encoding)� isinstance�str�bytes�master_encoding)�or r r �polystr9 s r c C s, t | t�r| S t | t�s t| �S t| td�S )z%Polymorphic string encoding function.r )r r r r r r r r � polybytesC s r c C s8 z t | �W S ty2 } z| W Y d}~S d}~0 0 dS )zPolymorphic ord() functionN)�ord� TypeError��cZter r r �polyordK s r c C s8 z t | �W S ty2 } z| W Y d}~S d}~0 0 dS )zPolymorphic chr() functionN)�chrr r r r r �polychrR s r c C s | � t��d�S )z)Polymorphic string_escape/unicode_escape.Zunicode_escape)�encoder r r r r r r Y s c C s t j| jdddd�S )z/Standard input/output wrapper factory function.�utf-8� T)r �newline�line_buffering)�io� TextIOWrapper�buffer)�streamr r r �make_std_wrappera s �r! r T)�__doc__�sysr Zforced_utf8r r r ZunicodeZpolyunicoder r r r Z raw_inputZ polyinputr r �inputr! �stdoutr �lower�stderrr r r r �<module> s4