ruạṛ
a �u:j�$ � @ st d dl Z d dlZd dlZze W n ey6 eZY n0 dd� Zdd� Zdd� Zdd � Z d d� Z dd � Zdd� ZdS )� Nc C s ddl m} || ��d S )Nr )�DistutilsSetupError)�cffi._shimmed_dist_utilsr )�msgr � r �H/opt/bart/bart_venv/lib64/python3.9/site-packages/cffi/setuptools_ext.py�error s r c C sT t | ��}|�� }W d � n1 s&0 Y |d7 }t|| d�}t|||� d S )N� �exec)�open�read�compiler )�filename�glob�f�src�coder r r �execfile s &r c C s� ddl m} t|t�s*tdt|�jf � t|�}z|�d�\}}W n t yd td|f � Y n0 t j�|�s�d}|� dd�d }t j�|�r�d |d | f }td||f � d|d �}t||� z|| }W n" ty� td||f � Y n0 t||��s |� }t||��s,td|t|�jf � t|d��sFtd|f � |j\} } }}|j�rn|�� }|�|� | d u �r�t| || � nt| || | ||� d S )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�hasattrr Z_windows_unicode�copyZ_apply_windows_unicode�_add_py_module� _add_c_module) �distZmod_specr Zbuild_file_nameZffi_var_name�extZ rewrittenZmod_vars�ffi�module_name�source�source_extension�kwdsr r r �add_cffi_module sV �� � �� r2 c C s� ddl m} ddlm} d|vr|ttd�s||jr|ddl}z(t|j � d�d �}|dkr^d |d<