HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/mercurial/__pycache__/policy.cpython-310.pyc
o

�]Lb��@s�ddlmZddlZddlZddlmZdZdddd	d
ddd�Zzddlm	Z	e	j
ZWn	ey4Ynwd
ejvr<dZej
ddkrQdejvrPejd�d�Znej�de�Zdd�Zdddddd�Zddddd�Zdd�Zdd�Zd d!�Zd$d"d#�ZdS)%�)�absolute_importN�)�getattr�allow)�cextN)r�pure)�cffiN)rr)Nr)�cr�cffis
cffi-allowspysrust+csrust+c-allow)�__modulepolicy__�__pypy__r
��HGMODULEPOLICYzutf-8cCs`i}t|t�||gdd�}zt||�||<}Wn
ty%td|��wt|dd�||S)Nr)�levelzcannot import name %s�__doc__)�
__import__�globalsr�AttributeError�ImportError)�pkgname�modname�
fakelocals�pkg�mod�r�2/usr/lib/python3/dist-packages/mercurial/policy.py�_importfrom@s�r��))r�base85)r�bdiff)r�mpatch)r�osutil�r�parsersr#)rr)r�
charencode)rr$))rr%)rr)rr%)rr$cCs:t�||f�}t|dd�}||krtd||||f��dS)N�versionz=cannot import module %s.%s (expected version: %d, actual: %r))�
_cextversions�getrr)rrr�expected�actualrrr�	_checkmod_s
���r+cCs�ztt\}}Wn
tytdt��w|s|sJ�|rIt�||f||f�\}}zt||�}||kr:t|||�|WStyH|sF�Ynwt�||f||f�\}}t||�S)z7Import module according to policy and check API versionzinvalid HGMODULEPOLICY %r)�
_packageprefs�policy�KeyErrorr�
_modredirectsr(rr+)r�verpkg�purepkg�pn�mnrrrr�	importmodjs(�
��
r4cCs
t�d�S)z;Assuming the policy is a Rust one, tell if it's permissive.s-allow)r-�endswithrrrr�_isrustpermissives
r6cCs~t�d�s|Sztd|�}Wntyt�r|YS�w|dur$|Szt||�WSty>t�r8|YStd|��w)aImport Rust module according to policy and availability.

    If policy isn't a Rust one, this returns `default`.

    If either the module or its member is not available, this returns `default`
    if policy is permissive and raises `ImportError` if not.
    srust�rustextNzCannot import name %s)r-�
startswithrrr6rr)r�member�defaultrrrr�
importrust�s$
��r;)NN)�
__future__r�os�sys�pycompatrr-r,�r�modulepolicyr�builtin_module_names�version_info�environ�encoder(rr'r/r+r4r6r;rrrr�<module>sT�
�

��
�