
    g
                     \    d dl Z d dlZ G d de      Z G d de      Z G d de      Zd Zy)	    Nc                   (     e Zd ZdZdd fd
Z xZS )UserExceptionz3 An exception capturing user friendly information. Ndetailc                >    t         |           || _        || _        y)z_ Initialise the exception with its user friendly text and the
        optional detail.
        N)super__init__textr   )selfr
   r   	__class__s      3lib/python3.12/site-packages/sipbuild/exceptions.pyr	   zUserException.__init__   s    
 		    __name__
__module____qualname____doc__r	   __classcell__r   s   @r   r   r      s    ='+  r   r   c                   (     e Zd ZdZdd fd
Z xZS )UserFileExceptionz* An exception related to a specific file. Nr   c                H    t         |   dj                  ||      |       y) Initialise the exception. {0}: {1}r   N)r   r	   format)r   filenamer
   r   r   s       r   r	   zUserFileException.__init__-   s$     	**8T:6Jr   r   r   s   @r   r   r   *   s    415 K Kr   r   c                   (     e Zd ZdZdd fd
Z xZS )UserParseExceptionz9 An exception related to the parsing of a specific file. Nr   c                *    t         |   |d|       y)r   zunable to parse filer   N)r   r	   )r   r   r   r   s      r   r	   zUserParseException.__init__6   s     	#9&Ir   r   r   s   @r   r   r   3   s    C+/ J Jr   r   c                 0   t        | t              r| j                  'dj                  | j                  | j                        }n| j                  }t        dj                  t        j                  j                  t        j                  d         |      t        j                         t        j                  d       t        dj                  t        j                  j                  t        j                  d               t        j                         | )z# Tell the user about an exception. r   r   )file   z"{0}: An internal error occurred...)
isinstancer   r   r   r
   printospathbasenamesysargvstderrexit)emessages     r   handle_exceptionr.   <   s     !]#88 ''9GffGj 0 0! =wGZZ	! 	 
077GG$$SXXa[13
 Gr   )r%   r(   	Exceptionr   r   r   r.    r   r   <module>r1      s;   0 
 
I K KJ* Jr   