HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/site-packages/cffi/__pycache__/setuptools_ext.cpython-38.pyc
U

KD�g�"�@snddlZddlZzeWnek
r0eZYnXdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�NcCsddlm}||��dS)Nr)�DistutilsSetupError)�cffi._shimmed_dist_utilsr)�msgr�r�@/opt/cppython/lib/python3.8/site-packages/cffi/setuptools_ext.py�error
src	Cs@t|��}|��}W5QRX|d7}t||d�}t|||�dS)N�
�exec)�open�read�compiler	)�filename�glob�f�src�coderrr�execfiles

rc
Cs�ddlm}t|t�s*tdt|�jf�t|�}z|�d�\}}Wn"t	k
rftd|f�YnXt
j�|�s�d}|�
dd�d	}t
j�|�r�d
|d|f}td||f�d|d
�}t||�z||}Wn$tk
r�td||f�YnXt||��s|�}t||��s0td|t|�jf�t|d��sJtd|f�|j\}	}
}}|j�rr|��}|�|�|
dk�r�t|||	�nt|||	|
||�dS)Nr)�FFIzEargument to 'cffi_modules=...' must be a str or a list of str, not %r�:z3%r must be of the form 'path/build.py:ffi_variable'��.�/�.pyz (rewrite cffi_modules to [%r])z#%r does not name an existing file%sZ__cffi__)�__name__�__file__z!%r: object %r not found in modulez"%r is not an FFI instance (got %r)�_assigned_sourcez*%r: the set_source() method was not called)Zcffi.apir�
isinstance�
basestringr�typer�str�split�
ValueError�os�path�exists�replacer�KeyError�hasattrrZ_windows_unicode�copyZ_apply_windows_unicode�_add_py_module�
_add_c_module)
�distZmod_specrZbuild_file_nameZffi_var_name�extZ	rewrittenZmod_vars�ffi�module_name�source�source_extension�kwdsrrr�add_cffi_modulesV

��
�

��

r2cCsvddlm}d|krrttd�sr|jrrddl}z(t|j�d�d�}|dkrRd|d<Wnt	k
rpd|d<YnX|S)	a7
    Add py_limited_api to kwds if setuptools >= 26 is in use.
    Do not alter the setting if it already exists.
    Setuptools takes care of ignoring the flag on Python 2 and PyPy.

    CPython itself should ignore the flag in a debugging version
    (by not listing .abi3.so in the extensions it supports), but
    it doesn't so far, creating troubles.  That's why we check
    for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
    of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)

    On Windows, with CPython <= 3.4, it's better not to use py_limited_api
    because virtualenv *still* doesn't copy PYTHON3.DLL on these versions.
    Recently (2020) we started shipping only >= 3.5 wheels, though.  So
    we'll give it another try and set py_limited_api on Windows >= 3.5.
    r��
recompilerZpy_limited_api�gettotalrefcountNr�T)
�cffir4r'�sysZUSE_LIMITED_API�
setuptools�int�__version__�	partitionr!)�	Extensionr1r4r9Zsetuptools_major_versionrrr�_set_py_limited_apiIs�r>c
	s�ddlm}ddlm}m�m�ddlm�dg}|�|�	dg��t
||�}|f�|d�|���d
��������	fdd	�	�|jdkr�g|_|j���|j
�d
|��G���fdd�d��}	|	|j
d
<dS)Nr��	build_ext)r=�log�mkpathr3�$PLACEHOLDER�sources)�namerDcs\tj�|���}��d|��|�|dk	r:|��������|�}|sX��d�|S�Nzgenerating cffi module %rzalready up-to-date)r"r#�join�infoZ
make_c_source)Ztmpdir�pre_runZc_file�updated)r,r-rArBr.r4r/r0rr�make_modus

z_add_c_module.<locals>.make_modr@cseZdZ���fdd�ZdS)z)_add_c_module.<locals>.build_ext_make_modcs:�jddkr,t|dd�}�|j|��jd<��|�dS)NrrCrI)rD�getattr�
build_temp�run)�selfrI��
base_classr,rKrrrN�sz-_add_c_module.<locals>.build_ext_make_mod.runN�r�
__module__�__qualname__rNrrPrr�build_ext_make_mod�srU)N)�setuptools.command.build_extr@rr=rArBr7r4�extend�popr>�ext_modules�append�cmdclass�get)
r+r-r.r/r0r1r@r=Z
allsourcesrUr)
rQr,r-rArKrBr.r4r/r0rr*js

r*cs�ddlm}ddlm}ddlm�m�ddlm������fdd��|j	�
d|��G���fd	d
�d
��}||j	d<|jdkr�g|_|j���|j	�
d|��G���fdd
�d
��}||j	d<dS)Nr)�build_pyr?)rArBr3cs>��d|��tj�|������|�}|s:��d�dSrF)rHr"r#�dirnameZmake_py_source)Zpy_filerJ)r-rArBr.r4rr�generate_mod�s
z$_add_py_module.<locals>.generate_modr]cs*eZdZ���fdd�Z��fdd�ZdS)z)_add_py_module.<locals>.build_py_make_modcs@��|���d�}|dd7<�tjj|jf|���dS)Nr���r)rNr r"r#rG�	build_lib)rO�module_path�rQr_r.rrrN�s

z-_add_py_module.<locals>.build_py_make_mod.runcs:|j}z&|r �fdd�|D�|_��|�W�S||_XdS)Ncsg|]}|�kr|�qSrr)�.0�m)r.rr�
<listcomp>�s�zN_add_py_module.<locals>.build_py_make_mod.get_source_files.<locals>.<listcomp>)�
py_modules�get_source_files)rOZsaved_py_modules)rQr.rrrh�sz:_add_py_module.<locals>.build_py_make_mod.get_source_filesN)rrSrTrNrhrrcrr�build_py_make_mod�srir@cseZdZ���fdd�ZdS)z*_add_py_module.<locals>.build_ext_make_modcsb��|�|jr^��d�}d�|dd��}|�d�}|�|�}|dd}�tj�||��dS)Nrr`r]r)rNZinplacer rG�get_finalized_commandZget_package_dirr"r#)rOrb�packager]�package_dir�	file_name��base_class_2r_r.rrrN�s



z._add_py_module.<locals>.build_ext_make_mod.runNrRrrnrrrU�srU)
Zsetuptools.command.build_pyr]rVr@rrArBr7r4r[r\rgrZ)r+r-r.r]r@rirUr)rQror-r_rArBr.r4rr)�s


r)cCs4|dkst�t|t�r|g}|D]}t||�q dS)N�cffi_modules)�AssertionErrorrrr2)r+�attr�valueZcffi_modulerrrrp�s

rp)r"r8r�	NameErrorrrrr2r>r*r)rprrrr�<module>s

-!,<