403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/numpy/testing/_private/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/numpy/testing/_private/__pycache__/extbuild.cpython-312.pyc
�

	�g� ���dZddlZddlZddlZddlZddlZddlZddgZddgdd�d�Zggfd�Z	d	�Z
d
�Zd�Zgggfd�Z
d
�Zd�Zy)zb
Build a c-extension module on-the-fly in tests.
See build_and_import_extensions for usage hints

�N�build_and_import_extension�compile_extension_module�)�prologue�	build_dir�include_dirs�	more_initc��|t||�z}d}|stjd�}|r
|dz
}||z
}|dz
}t|||�}	t	||||�}	ddl}|jj||	�}|jj|�}
|jj|
�|
S#t
$r}
t
d|�d��|
�d}
~
wwxYw)	a
    Build and imports a c-extension module `modname` from a list of function
    fragments `functions`.


    Parameters
    ----------
    functions : list of fragments
        Each fragment is a sequence of func_name, calling convention, snippet.
    prologue : string
        Code to precede the rest, usually extra ``#include`` or ``#define``
        macros.
    build_dir : pathlib.Path
        Where to build the module, usually a temporary directory
    include_dirs : list
        Extra directories to find include files when compiling
    more_init : string
        Code to appear in the module PyMODINIT_FUNC

    Returns
    -------
    out: module
        The module will have been loaded and is ready for use

    Examples
    --------
    >>> functions = [("test_bytes", "METH_O", """
        if ( !PyBytesCheck(args)) {
            Py_RETURN_FALSE;
        }
        Py_RETURN_TRUE;
    """)]
    >>> mod = build_and_import_extension("testme", functions)
    >>> assert not mod.test_bytes('abc')
    >>> assert mod.test_bytes(b'abc')
    z�
    PyObject *mod = PyModule_Create(&moduledef);
    #ifdef Py_GIL_DISABLED
    PyUnstable_Module_SetGIL(mod, Py_MOD_GIL_NOT_USED);
    #endif
           �.z.#define INITERROR return NULL
                z
return mod;zcould not compile in �:Nr)
�
_make_methods�pathlib�Path�_make_sourcer�	Exception�RuntimeError�importlib.util�util�spec_from_file_location�module_from_spec�loader�exec_module)�modname�	functionsrrrr	�body�init�
source_string�mod_so�e�	importlib�spec�foos              �AC:\Python312\Lib\site-packages\numpy/testing/_private/extbuild.pyrrs���N�m�I�w�7�7�D��D���L�L��%�	����	���	����O��D� ��$��5�M�H�)��Y��m�=��
��>�>�1�1�'�6�B�D�
�.�.�
)�
)�$�
/�C��K�K���C� ��J���H��2�9�+�Q�?�@�a�G��H�s�B.�.	C�7C�Cc���|jd�d}||z}|jd��t||�}|tjd�gz}t|||z|gg��S)aH
    Build an extension module and return the filename of the resulting
    native code file.

    Parameters
    ----------
    name : string
        name of the module, possibly including dots if it is a module inside a
        package.
    builddir : pathlib.Path
        Where to build the module, usually a temporary directory
    include_dirs : list
        Extra directories to find include files when compiling
    libraries : list
        Libraries to link into the extension module
    library_dirs: list
        Where to find the libraries, ``-L`` passed to the linker
    r���T��exist_ok�	INCLUDEPY)�outputfilenamer�	libraries�library_dirs)�split�mkdir�_convert_str_to_file�	sysconfig�get_config_var�
_c_compile)	�name�builddirrrr*r+r�dirname�cfiles	         r#rrTso��*�j�j��o�b�!�G���o�G��M�M�4�M� � ���8�E��9�#;�#;�K�#H�"I�I�L��
�g��/�!�R�b�
�
�c��|dz}|jd�5}|jt|��ddd�|S#1swY|SxYw)zHelper function to create a file ``source.c`` in `dirname` that contains
    the string in `source`. Returns the file name
    zsource.c�wN)�open�write�str)�sourcer4�filename�fs    r#r.r.usF����#�H�	���s�	��q�	����F�����O���O�s	�<�Ac
�&�g}g}|D]V\}}}|�d|��}d|vrd}nd}|jd|�d|�d|�d��d	j|||�
�}	|j|	��Xdj|�dtdj|�|�
�zz}
|
S)z� Turns the name, signature, code in functions into complete functions
    and lists them in a methods_table. Then turns the methods_table into a
    ``PyMethodDef`` structure and returns the resulting code fragment ready
    for compilation
    �_�
METH_KEYWORDSz2(PyObject *self, PyObject *args, PyObject *kwargs)z (PyObject *self, PyObject *args)z{"z", (PyCFunction)z, z},z^
        static PyObject* {cfuncname}{signature}
        {{
        {code}
        }}
        )�	cfuncname�	signature�code�
a6
    static PyMethodDef methods[] = {
    %(methods)s
    { NULL }
    };
    static struct PyModuleDef moduledef = {
        PyModuleDef_HEAD_INIT,
        "%(modname)s",  /* m_name */
        NULL,           /* m_doc */
        -1,             /* m_size */
        methods,        /* m_methods */
    };
    )�methodsr)�append�format�join�dict)rr�
methods_table�codes�funcname�flagsrDrBrC�	func_coders           r#r
r
s����M��E�!*� ���%��&��1�	��e�#�L�I�:�I����08�)�U�K�	M��

�F�Y�)�$�F�G�	�	���Y�� � �9�9�U����t�y�y��/��
A�B�B�D��Kr6c�(�dt|||��z}|S)zG Combines the code fragments into source code ready to be compiled
    zn
    #include <Python.h>

    %(body)s

    PyMODINIT_FUNC
    PyInit_%(name)s(void) {
    %(init)s
    }
    )r2rr)rJ)r2rrrDs    r#rr�s&��	��
��4���D��Kr6c	��tjdk(r6dg}dtjj	tj
d�zg}n+tjj
d�rgd�}g}ngx}}	tjdk(r|dgz}tjdk(r�d	D]~}|d
z|vr6tjj|d
z�r|j|d
z�|dz|vs�Htjj|dz�s�k|j|dz���|jt��}t|||||||�|S)N�win32z/we4013z	/LIBPATH:�libs�linux)z-O0z-gz%-Werror=implicit-function-declarationz-fPICz/DEBUG�darwin)z/sw/z/opt/local/�include�lib)�sys�platform�os�pathrI�base_prefix�
startswith�existsrG�with_suffix�
get_so_suffix�build)r5r)rr*r+�
compile_extra�
link_extra�ss        r#r1r1�s,��
�|�|�w��"��
�!�B�G�G�L�L����&�$I�I�J�
�	���	 �	 ��	)�K�
��
�%'�'�
�
��
�|�|�w���8�*�,�
�
�|�|�x��(�	/�A��I�
�\�1������q�9�}�5��#�#�A�	�M�2��5�y��,�������E�	�1J��#�#�A��I�.�	/�$�/�/�
��@�N�	�
�~��z��i��/��r6c���|jdz}tj|d��|jd}t	|jdzd�5}	|D�
cgc]}
d|
z��	}}
|D�
cgc]}
d|
z��	}}
|	jt
jd	|�d
|jd�d|�d|�d
|�d|�d|�d���ddd�tjdk(rtjgd�|��ntjgd�|��tjddg|��tjt||z�dz|j|z�ycc}
wcc}
w#1swY��xYw)zuse meson to buildraTr&r%zmeson.build�wtz-Iz-Lz;            project('foo', 'c')
            shared_module('z', 'z',
                c_args: z + z,
                link_args: z,
                link_with: z_,
                name_prefix: '',
                name_suffix: 'dummy',
            )
        NrR)�meson�setupz--buildtype=release�--vsenv�..)�cwd)rgrhrirjrg�compilez.dummy)�parentrZ�makedirs�partsr9r:�textwrap�dedentrXrY�
subprocess�
check_call�renamer;)
r5r)rbrcrr*r+r�so_name�fid�d�includes�	link_dirss
             r#rara�sm�����w�&�I��K�K�	�D�)��"�"�2�&�G�	
�e�l�l�]�*�D�	1��S�&2�3��D�1�H�3��3�'3�4�!�T�A�X�4�	�4��	�	�(�/�/�'�#�9�D����R��(9�:�!�
�#�m�_�5�%�;�c�*��6�%�;�'	�	#�	
�		���|�|�w�����0�#,�	 �	���A�"+�	 ����7�I�.�I�>��I�I�c�)�g�%�&��1�5�<�<�'�3I�J��/4��4���s+�E�E� E�&E�2A	E�
E�E(c�8�tjd�}|sJ�|S)N�
EXT_SUFFIX)r/r0)�rets r#r`r`�s��
�
"�
"�<�
0�C��J�3��Jr6)�__doc__rZrrrrXr/rp�__all__rrr.r
rr1rar`�r6r#�<module>r�st���
���
���'�)C�
D��)+�d��2�@�J"$�"�
�B�%�P�$46����>K�Br6

Youez - 2016 - github.com/yon3zu
LinuXploit