HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/compat.cpython-310.pyc
o

�N�g,�@sPdZddlZddlZddlZddlZddlZdd�Zdd�Zdd�Z	d	d
�Z
dS)z#
Compatibility functions for utils
�NcCs6tj|}t|d�st|dtjj|jdd��dSdS)zN
    Compatibility helper function to make __utils__ available on demand.
    Z	__utils__)Z	pack_selfN)�sys�modules�hasattr�setattr�salt�loader�utilsZ__opts__)�name�mod�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/compat.py�pack_dunder
s

��r
cCs:dd�}tj}z|tjtj<t�|�}W|t_|S|t_w)a�
    Compatibility helper function to allow copy.deepcopy copy bound methods
    which is broken on Python 2.6, due to the following bug:
    https://bugs.python.org/issue1515

    Warnings:
        - This method will mutate the global deepcopy dispatcher, which means that
        this function is NOT threadsafe!

        - Not Py3 compatible. The intended use case is deepcopy compat for Py2.6

    cSst|�|jt�|j|�|j�S)N)�typeZim_func�copy�deepcopyZim_selfZim_class)�x�memorrr�_deepcopy_method(sz(deepcopy_bound.<locals>._deepcopy_method)r�_deepcopy_dispatch�types�
MethodTyper)r	rZpre_dispatch�retrrr�deepcopy_bounds�rcCs4t|t�rt|t�r||krdSdS||k||kS)z�
    Compatibility helper function to replace the ``cmp`` function from Python 2. The
    ``cmp`` function is no longer available in Python 3.

    cmp(x, y) -> integer

    Return negative if x<y, zero if x==y, positive if x>y.
    r���)�
isinstance�dict)r�yrrr�cmp4s	rcCs(zt�|�WStyt|�YSw)zX
    Compatibility helper function to replace the ``reload`` builtin from Python 2.
    )�	importlib�reload�AttributeError)r
rrrrBs
�r)�__doc__rrrrZsalt.loaderrr
rrrrrrr�<module>s