o ai2 @ s0 d dl mZ ddlZddlZddlZddlmZmZ d dlm Z dZ dZedZ G d d d eZG dd deZG d d deZG dd deZdd Zdd Zdd Zdd Zdd Zdd Zd7ddZd d! Zd"d# Zd$d% Zd&d' Zd7d(d)Zd*d+ Zd,d- Z d.d/ Z!d8d1d2Z"d9d3d4Z#d:d5d6Z$dS ); )idnadata N)UnionOptional)intranges_contain s xn--u [.。.。]c @ e Zd ZdZdS ) IDNAErrorz7 Base exception for all IDNA-encoding related problems N__name__ __module____qualname____doc__ r r /builddir/build/BUILDROOT/alt-python310-pip-21.3.1-5.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_vendor/idna/core.pyr r c @ r ) IDNABidiErrorz= Exception when bidirectional requirements are not satisfied Nr r r r r r r r c @ r )InvalidCodepointz> Exception when a disallowed or unallocated codepoint is used Nr r r r r r r r c @ r )InvalidCodepointContextzE Exception when the codepoint is not valid in the context it is used Nr r r r r r r r c C s0 t t| }|dkrt t| std|S )Nr z Unknown character in unicodedata)unicodedata combiningchrname ValueError)cpvr r r _combining_class s r c C s t t| tj| S )N)r ordr scripts)r scriptr r r _is_script( s r c C s | dS )Npunycode)encodesr r r _punycode, r% c C s d | S )NzU+{:04X})formatr# r r r _unot0 r&