File: //usr/lib/python3/dist-packages/mercurial/__pycache__/error.cpython-310.pyc
o
�]Lb�G � @ s� d Z ddlmZ ddlZddlmZ ejr'ddlmZm Z m
Z
mZmZm
Z
mZ dd� ZG d d
� d
e�ZG dd� dee�ZG d
d� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� dee�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�Z G d#d$� d$e�Z!G d%d&� d&e�Z"G d'd(� d(e�Z#G d)d*� d*e#�Z$G d+d,� d,e�Z%G d-d.� d.e�Z&G d/d0� d0e�Z'G d1d2� d2e�Z(G d3d4� d4e�Z)G d5d6� d6e�Z*G d7d8� d8e�Z+G d9d:� d:e�Z,G d;d<� d<e�Z-G d=d>� d>e-�Z.G d?d@� d@e-�Z/G dAdB� dBe�Z0G dCdD� dDe�Z1G dEdF� dFe1�Z2G dGdH� dHe�Z3G dIdJ� dJe�Z4G dKdL� dLe4�Z5G dMdN� dNe4�Z6dOdP� Z7dQdR� Z8G dSdT� dTe3�Z9G dUdV� dVee�Z:G dWdX� dXe:�Z;G dYdZ� dZe;�Z<G d[d\� d\e:�Z=G d]d^� d^e:�Z>G d_d`� d`e?�Z@G dadb� dbe�ZAG dcdd� dde�ZBG dedf� dfe?�ZCG dgdh� dheC�ZDG didj� djeC�ZEG dkdl� dleF�ZGG dmdn� dne�ZHG dodp� dpeI�ZJG dqdr� dre�ZKG dsdt� dteF�ZLG dudv� dveeF�ZMG dwdx� dxe�ZNG dydz� dzeO�ZPG d{d|� d|eP�ZQG d}d~� d~eF�ZRG dd�� d�e�ZSG d�d�� d�e�ZTG d�d�� d�e�ZUG d�d�� d�e�ZVG d�d�� d�e�ZWG d�d�� d�e�ZXG d�d�� d�e�ZYG d�d�� d�e�ZZG d�d�� d�e�Z[dS )�zdMercurial exceptions.
This allows us to catch exceptions at higher levels without forcing
imports.
� )�absolute_importN� )�pycompat)�Any�AnyStr�Iterable�List�Optional�Sequence�Unionc C sB | j sdS t| j �dkrt�| j d �S dd�dd� | j D �� S )z?Byte-stringify exception in the same way as BaseException_str()� r r s (%s)� , c s s � | ]
}d t �|� V qdS )s '%s'N)r �bytestr)�.0�a� r �1/usr/lib/python3/dist-packages/mercurial/error.py� <genexpr>( s � z_tobytes.<locals>.<genexpr>)�args�lenr r �join)�excr r r �_tobytes! s
r c s e Zd ZdZ� fdd�Z� ZS )�Hintz�Mix-in to provide a hint of an error
This should come first in the inheritance list to consume a hint and
pass remaining arguments to the exception class.
c s( |� dd �| _tt| �j|i |�� d S )N�hint)�popr �superr �__init__)�selfr �kw�� __class__r r r 2 s z
Hint.__init__��__name__�
__module__�__qualname__�__doc__r �
__classcell__r r r r r + s r c @ s@ e Zd ZdZdZdZddd�Zdd� Zej rdd� Z
d d
� ZdS )�Errorz Base class for Mercurial errors.Nc C s || _ || _t�| |� d S �N)�messager � Exceptionr )r r* r r r r r = s zError.__init__c C s | j S r) )r* �r r r r � __bytes__E s zError.__bytes__c C s t �| �� �S r) )r �sysstrr- r, r r r �__str__J s z
Error.__str__c C �6 ddl m} |d�| j }| jr||d�| j 7 }|S )Nr ��_s
abort: %s
� (%s)
��i18nr2 r* r �r r2 r* r r r �formatQ �
zError.formatr) )r# r$ r% r&