3 MZ @ sn d dl Z d dlZye W n ek r0 eZY nX dd Zdd Zdd Zdd Zd d Z dd Z dd ZdS ) Nc C s ddl m} || d S )Nr )DistutilsSetupError)Zdistutils.errorsr )msgr r &/usr/lib64/python3.6/setuptools_ext.pyerror s r c C s@ t | }|j }W d Q R X |d7 }t|| d}t||| d S )N exec)openreadcompiler )filenameZglobfsrccoder r r execfile s r c C s ddl m} t|ts*tdt|jf t|}y|jd\}}W n" t k rf td|f Y nX t jj|sd}|j ddd }t jj|rd |d | f }td||f d|d }t|| y|| }W n$ tk r td||f Y nX t||s| }t||s0td|t|jf t|dsJtd|f |j\} } }}|jrr|j }|j| | d krt| || 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' ./z.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 strsplit ValueErrorospathexistsreplacer KeyErrorhasattrr Z_windows_unicodecopyZ_apply_windows_unicode_add_py_module _add_c_module) distZmod_specr Zbuild_file_nameZffi_var_nameextZ rewrittenZmod_varsffimodule_namesourcesource_extensionkwdsr r r add_cffi_module sL r/ c C sp d|krlt td rltjdkrlddl}y(t|jjdd }|dkrLd|d<