ok
Direktori : /opt/alt/python38/lib64/python3.8/site-packages/pycares/__pycache__/ |
Current File : //opt/alt/python38/lib64/python3.8/site-packages/pycares/__pycache__/utils.cpython-38.pyc |
U ��ma? � @ s\ zd dl ZW n ek r$ dZY nX dd� Zdd� Zdd� Zdd � Zd d� ZdddgZdS )� Nc C s. t | t�r| �d�S t | t�r"| S td��d S �N�asciiz1only str (ascii encoding) and bytes are supported)� isinstance�str�encode�bytes� TypeError��data� r �@/opt/alt/python38/lib64/python3.8/site-packages/pycares/utils.py�ascii_bytes s r c C sJ t | t�r| S t | t�r>z| �d�W S tk r< | Y S X td��d S r )r r r �decode�UnicodeDecodeErrorr r r r r � maybe_str s r c C s | D ]}t |�dkr dS qdS )N� FT)�ord)�text�cr r r �is_all_ascii s r c C sL | � d�}g }|D ].}t|�r0|�|�d�� q|�t�|�� qd�|�S )N�.r � .)�splitr �appendr �idna2008�join)�name�parts�r�partr r r �parse_name_idna2008! s r c C sP t | t�r6t| �r| �d�S td k r,t| �S | �d�S t | t�rD| S td��d S )Nr �idnaz only str and bytes are supported)r r r r r r r r )r r r r � parse_name+ s r"