HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib64/python3.9/site-packages/gssapi/__pycache__/_utils.cpython-39.opt-1.pyc
a

��_z�@s�ddlZddlZddlZddlZddlmZddlmZdd�Z	dd�Z
deeed�d	d
�Zda
dd
�Zdd�Zdd�Zejdd��Zejdd��ZGdd�de�ZdS)�N)�Optional)�GSSErrorcCs8zd�|�}t|�tj|WSty2YdS0dS)aaImport a GSSAPI extension module

    This method imports a GSSAPI extension module based
    on the name of the extension (not including the
    'ext_' prefix).  If the extension is not available,
    the method retuns None.

    Args:
        name (str): the name of the extension

    Returns:
        module: Either the extension module or None
    zgssapi.raw.ext_{0}N)�format�
__import__�sys�modules�ImportError)�name�path�r�3/usr/lib64/python3.9/site-packages/gssapi/_utils.py�import_gssapi_extensions
r
cs"�fdd�}�fdd�}t||�S)Ncs"|r|j���n|j���dS�N)�flags�add�discard)�self�val��flagrr�setter$szflag_property.<locals>.settercs
�|jvSr)r)rrrr�getter*szflag_property.<locals>.getter��property)rrrrrr�
flag_property#sr)r	�doccs�fdd�}t||d�S)a<Creates a property based on an inquire result

    This method creates a property that calls the
    :python:`_inquire` method, and return the value of the
    requested information.

    Args:
        name (str): the name of the 'inquire' result information

    Returns:
        property: the created property
    cs4|jsd��d�}t|��t|jfi�di����S)NzCannot read zF from a security context whose establishment has not yet been started.T)�_started�AttributeError�getattrZ_inquire)r�msg�r	rr�inquire_property>sz*inquire_property.<locals>.inquire_property)rr)r	rr!rr rr!0sr!zUTF-8cCstS)z�Gets the current encoding used for strings.

    This value is used to encode and decode string
    values like names.

    Returns:
        str: the current encoding
    ��	_ENCODINGrrrr�
_get_encodingMs	r$cCs|adS)z�Sets the current encoding used for strings

    This value is used to encode and decode string
    values like names.

    Args:
        enc: the encoding to use
    Nr"��encrrr�set_encodingYsr'cs$dd��t�fdd�t�|�D��S)z&Encodes any relevant strings in a dictcSst|tj�r|�t�S|SdSr)�
isinstance�sixZ	text_type�encoder#)�xrrrr&is
z_encode_dict.<locals>.encc3s"|]\}}�|��|�fVqdSrr)�.0�k�vr%rr�	<genexpr>o�z_encode_dict.<locals>.<genexpr>)�dictr)Z	iteritems)�drr%r�_encode_dictgsr3c
Os�z||g|�Ri|��WSty�}z\|jdurv|jrv||_tjrXt��djj|_	n|j
j|j_
|jWYd}~S�WYd}~n
d}~00dS)a�Optionally defer exceptions and return a token instead

    When `__DEFER_STEP_ERRORS__` is set on the implementing class
    or instance, methods wrapped with this wrapper will
    catch and save their :python:`GSSError` exceptions and
    instead return the result token attached to the exception.

    The exception can be later retrived through :python:`_last_err`
    (and :python:`_last_tb` when Python 2 is in use).
    N�)r�token�__DEFER_STEP_ERRORS__�	_last_errr)�PY2r�exc_info�tb_next�_last_tb�
__traceback__)�funcr�args�kwargs�errr�catch_and_return_tokenss
rAcOs�|jdurZz:tjr,t�t|j�|j|j�n|j�Wtjr>|`d|_qptjrP|`d|_0n||g|�Ri|��Stjdd��}dS)z�Check and raise deferred errors before running the function

    This method checks :python:`_last_err` before running the wrapped
    function.  If present and not None, the exception will be raised
    with its original traceback.
    Nc_s@|jdur&z|j�Wd|_q<d|_0n||g|�Ri|��SdSr)r7)r=rr>r?rrr�check_last_err�s

z&check_last_err.<locals>.check_last_err)r7r)r8Zreraise�typer;�deco�	decorator)r=rr>r?rBrrrrB�s 	
��
rBcs eZdZdZ�fdd�Z�ZS)�CheckLastErrorz�Check for a deferred error on all methods

    This metaclass applies the :python:`check_last_err` decorator
    to all methods not prefixed by '_'.

    Additionally, it enabled `__DEFER_STEP_ERRORS__` by default.
    csVd|d<|D]2}||}t|tj�s&q|ddkrt|�||<qtt|��||||�S)NTr6r�_)r(�types�FunctionTyperB�superrF�__new__)�clsr	�parents�attrsZ	attr_name�attr��	__class__rrrK�szCheckLastError.__new__)�__name__�
__module__�__qualname__�__doc__rK�
__classcell__rrrPrrF�srF)N)rrHr)rErD�typingrZgssapi.raw.miscrr
r�strr!r#r$r'r3rArBrCrFrrrr�<module>s"


%