mirror of
https://github.com/house-of-vanity/fesmoo_perdoliq.git
synced 2025-08-21 16:17:15 +00:00
1317 lines
40 KiB
C
1317 lines
40 KiB
C
/* Generated code for Python source for module 'lxml'
|
|
* created by Nuitka version 0.6.0
|
|
*
|
|
* This code is in part copyright 2018 Kay Hayen.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#include "nuitka/prelude.h"
|
|
|
|
#include "__helpers.h"
|
|
|
|
/* The _module_lxml is a Python object pointer of module type. */
|
|
|
|
/* Note: For full compatibility with CPython, every module variable access
|
|
* needs to go through it except for cases where the module cannot possibly
|
|
* have changed in the mean time.
|
|
*/
|
|
|
|
PyObject *module_lxml;
|
|
PyDictObject *moduledict_lxml;
|
|
|
|
/* The module constants used, if any. */
|
|
extern PyObject *const_str_plain_isdir;
|
|
static PyObject *const_str_plain_include_path;
|
|
static PyObject *const_str_plain_get_include;
|
|
static PyObject *const_str_digest_d42b72c5a79ad18c1a3d0766951e7e66;
|
|
extern PyObject *const_str_plain___file__;
|
|
extern PyObject *const_str_plain_lxml;
|
|
extern PyObject *const_int_0;
|
|
extern PyObject *const_str_plain_path;
|
|
static PyObject *const_str_digest_902038a12cad885028a49bee17ed2177;
|
|
extern PyObject *const_str_plain_os;
|
|
static PyObject *const_str_plain_listdir;
|
|
static PyObject *const_str_plain_lxml_path;
|
|
extern PyObject *const_str_plain___path__;
|
|
static PyObject *const_str_digest_9861d683770e66a4e951df5d78950a09;
|
|
static PyObject *const_list_str_digest_902038a12cad885028a49bee17ed2177_list;
|
|
extern PyObject *const_str_plain_append;
|
|
extern PyObject *const_str_plain_join;
|
|
extern PyObject *const_str_plain_name;
|
|
static PyObject *const_str_plain_includes;
|
|
extern PyObject *const_str_plain___doc__;
|
|
extern PyObject *const_str_plain___cached__;
|
|
static PyObject *const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple;
|
|
static PyObject *module_filename_obj;
|
|
|
|
static bool constants_created = false;
|
|
|
|
static void createModuleConstants( void )
|
|
{
|
|
const_str_plain_include_path = UNSTREAM_STRING( &constant_bin[ 1040702 ], 12, 1 );
|
|
const_str_plain_get_include = UNSTREAM_STRING( &constant_bin[ 1040714 ], 11, 1 );
|
|
const_str_digest_d42b72c5a79ad18c1a3d0766951e7e66 = UNSTREAM_STRING( &constant_bin[ 1040725 ], 49, 0 );
|
|
const_str_digest_902038a12cad885028a49bee17ed2177 = UNSTREAM_STRING( &constant_bin[ 1040725 ], 37, 0 );
|
|
const_str_plain_listdir = UNSTREAM_STRING( &constant_bin[ 1040774 ], 7, 1 );
|
|
const_str_plain_lxml_path = UNSTREAM_STRING( &constant_bin[ 1040781 ], 9, 1 );
|
|
const_str_digest_9861d683770e66a4e951df5d78950a09 = UNSTREAM_STRING( &constant_bin[ 1040790 ], 183, 0 );
|
|
const_list_str_digest_902038a12cad885028a49bee17ed2177_list = PyList_New( 1 );
|
|
PyList_SET_ITEM( const_list_str_digest_902038a12cad885028a49bee17ed2177_list, 0, const_str_digest_902038a12cad885028a49bee17ed2177 ); Py_INCREF( const_str_digest_902038a12cad885028a49bee17ed2177 );
|
|
const_str_plain_includes = UNSTREAM_STRING( &constant_bin[ 127355 ], 8, 1 );
|
|
const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple = PyTuple_New( 6 );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 0, const_str_plain_os ); Py_INCREF( const_str_plain_os );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 1, const_str_plain_lxml_path ); Py_INCREF( const_str_plain_lxml_path );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 2, const_str_plain_include_path ); Py_INCREF( const_str_plain_include_path );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 3, const_str_plain_includes ); Py_INCREF( const_str_plain_includes );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 4, const_str_plain_name ); Py_INCREF( const_str_plain_name );
|
|
PyTuple_SET_ITEM( const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 5, const_str_plain_path ); Py_INCREF( const_str_plain_path );
|
|
|
|
constants_created = true;
|
|
}
|
|
|
|
#ifndef __NUITKA_NO_ASSERT__
|
|
void checkModuleConstants_lxml( void )
|
|
{
|
|
// The module may not have been used at all.
|
|
if (constants_created == false) return;
|
|
|
|
|
|
}
|
|
#endif
|
|
|
|
// The module code objects.
|
|
static PyCodeObject *codeobj_c4b39b215000f4e40a68a71f12bf6ed7;
|
|
|
|
static void createModuleCodeObjects(void)
|
|
{
|
|
module_filename_obj = const_str_digest_d42b72c5a79ad18c1a3d0766951e7e66;
|
|
codeobj_c4b39b215000f4e40a68a71f12bf6ed7 = MAKE_CODEOBJ( module_filename_obj, const_str_plain_get_include, 3, const_tuple_14c164d2ecedb284ab808b795aeabc24_tuple, 0, 0, CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE );
|
|
}
|
|
|
|
// The module function declarations.
|
|
static PyObject *MAKE_FUNCTION_lxml$$$function_1_get_include( );
|
|
|
|
|
|
// The module function definitions.
|
|
static PyObject *impl_lxml$$$function_1_get_include( struct Nuitka_FunctionObject const *self, PyObject **python_pars )
|
|
{
|
|
// Preserve error status for checks
|
|
#ifndef __NUITKA_NO_ASSERT__
|
|
NUITKA_MAY_BE_UNUSED bool had_error = ERROR_OCCURRED();
|
|
#endif
|
|
|
|
// Local variable declarations.
|
|
PyObject *var_os = NULL;
|
|
PyObject *var_lxml_path = NULL;
|
|
PyObject *var_include_path = NULL;
|
|
PyObject *var_includes = NULL;
|
|
PyObject *var_name = NULL;
|
|
PyObject *var_path = NULL;
|
|
PyObject *tmp_for_loop_1__for_iterator = NULL;
|
|
PyObject *tmp_for_loop_1__iter_value = NULL;
|
|
struct Nuitka_FrameObject *frame_c4b39b215000f4e40a68a71f12bf6ed7;
|
|
NUITKA_MAY_BE_UNUSED char const *type_description_1 = NULL;
|
|
PyObject *exception_type = NULL;
|
|
PyObject *exception_value = NULL;
|
|
PyTracebackObject *exception_tb = NULL;
|
|
NUITKA_MAY_BE_UNUSED int exception_lineno = 0;
|
|
NUITKA_MAY_BE_UNUSED PyObject *tmp_unused;
|
|
PyObject *exception_keeper_type_1;
|
|
PyObject *exception_keeper_value_1;
|
|
PyTracebackObject *exception_keeper_tb_1;
|
|
NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_1;
|
|
PyObject *tmp_return_value = NULL;
|
|
static struct Nuitka_FrameObject *cache_frame_c4b39b215000f4e40a68a71f12bf6ed7 = NULL;
|
|
PyObject *exception_keeper_type_2;
|
|
PyObject *exception_keeper_value_2;
|
|
PyTracebackObject *exception_keeper_tb_2;
|
|
NUITKA_MAY_BE_UNUSED int exception_keeper_lineno_2;
|
|
|
|
// Actual function code.
|
|
{
|
|
// Tried code:
|
|
MAKE_OR_REUSE_FRAME( cache_frame_c4b39b215000f4e40a68a71f12bf6ed7, codeobj_c4b39b215000f4e40a68a71f12bf6ed7, module_lxml, sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *)+sizeof(void *) );
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7 = cache_frame_c4b39b215000f4e40a68a71f12bf6ed7;
|
|
|
|
// Push the new frame as the currently active one.
|
|
pushFrameStack( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
|
|
// Mark the frame object as in use, ref count 1 will be up for reuse.
|
|
assert( Py_REFCNT( frame_c4b39b215000f4e40a68a71f12bf6ed7 ) == 2 ); // Frame stack
|
|
|
|
// Framed code:
|
|
{
|
|
PyObject *tmp_assign_source_1;
|
|
PyObject *tmp_name_name_1;
|
|
PyObject *tmp_globals_name_1;
|
|
PyObject *tmp_locals_name_1;
|
|
PyObject *tmp_fromlist_name_1;
|
|
PyObject *tmp_level_name_1;
|
|
tmp_name_name_1 = const_str_plain_os;
|
|
tmp_globals_name_1 = (PyObject *)moduledict_lxml;
|
|
tmp_locals_name_1 = Py_None;
|
|
tmp_fromlist_name_1 = Py_None;
|
|
tmp_level_name_1 = const_int_0;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 9;
|
|
tmp_assign_source_1 = IMPORT_MODULE5( tmp_name_name_1, tmp_globals_name_1, tmp_locals_name_1, tmp_fromlist_name_1, tmp_level_name_1 );
|
|
if ( tmp_assign_source_1 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 9;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
assert( var_os == NULL );
|
|
var_os = tmp_assign_source_1;
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_2;
|
|
PyObject *tmp_subscribed_name_1;
|
|
PyObject *tmp_mvar_value_1;
|
|
PyObject *tmp_subscript_name_1;
|
|
tmp_mvar_value_1 = GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___path__ );
|
|
|
|
if (unlikely( tmp_mvar_value_1 == NULL ))
|
|
{
|
|
tmp_mvar_value_1 = GET_STRING_DICT_VALUE( dict_builtin, (Nuitka_StringObject *)const_str_plain___path__ );
|
|
}
|
|
|
|
if ( tmp_mvar_value_1 == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_NameError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "name '%s' is not defined", "__path__" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 10;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_subscribed_name_1 = tmp_mvar_value_1;
|
|
tmp_subscript_name_1 = const_int_0;
|
|
tmp_assign_source_2 = LOOKUP_SUBSCRIPT_CONST( tmp_subscribed_name_1, tmp_subscript_name_1, 0 );
|
|
if ( tmp_assign_source_2 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 10;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
assert( var_lxml_path == NULL );
|
|
var_lxml_path = tmp_assign_source_2;
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_3;
|
|
PyObject *tmp_called_name_1;
|
|
PyObject *tmp_source_name_1;
|
|
PyObject *tmp_source_name_2;
|
|
PyObject *tmp_args_element_name_1;
|
|
PyObject *tmp_args_element_name_2;
|
|
if ( var_os == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "os" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 11;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_source_name_2 = var_os;
|
|
tmp_source_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_2, const_str_plain_path );
|
|
if ( tmp_source_name_1 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 11;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
tmp_called_name_1 = LOOKUP_ATTRIBUTE( tmp_source_name_1, const_str_plain_join );
|
|
Py_DECREF( tmp_source_name_1 );
|
|
if ( tmp_called_name_1 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 11;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
if ( var_lxml_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_1 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "lxml_path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 11;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_args_element_name_1 = var_lxml_path;
|
|
tmp_args_element_name_2 = const_str_plain_includes;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 11;
|
|
{
|
|
PyObject *call_args[] = { tmp_args_element_name_1, tmp_args_element_name_2 };
|
|
tmp_assign_source_3 = CALL_FUNCTION_WITH_ARGS2( tmp_called_name_1, call_args );
|
|
}
|
|
|
|
Py_DECREF( tmp_called_name_1 );
|
|
if ( tmp_assign_source_3 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 11;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
assert( var_include_path == NULL );
|
|
var_include_path = tmp_assign_source_3;
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_4;
|
|
PyObject *tmp_list_element_1;
|
|
CHECK_OBJECT( var_include_path );
|
|
tmp_list_element_1 = var_include_path;
|
|
tmp_assign_source_4 = PyList_New( 2 );
|
|
Py_INCREF( tmp_list_element_1 );
|
|
PyList_SET_ITEM( tmp_assign_source_4, 0, tmp_list_element_1 );
|
|
if ( var_lxml_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_assign_source_4 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "lxml_path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 12;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_list_element_1 = var_lxml_path;
|
|
Py_INCREF( tmp_list_element_1 );
|
|
PyList_SET_ITEM( tmp_assign_source_4, 1, tmp_list_element_1 );
|
|
assert( var_includes == NULL );
|
|
var_includes = tmp_assign_source_4;
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_5;
|
|
PyObject *tmp_iter_arg_1;
|
|
PyObject *tmp_called_name_2;
|
|
PyObject *tmp_source_name_3;
|
|
PyObject *tmp_args_element_name_3;
|
|
if ( var_os == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "os" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_source_name_3 = var_os;
|
|
tmp_called_name_2 = LOOKUP_ATTRIBUTE( tmp_source_name_3, const_str_plain_listdir );
|
|
if ( tmp_called_name_2 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
if ( var_include_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_2 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "include_path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_args_element_name_3 = var_include_path;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 14;
|
|
{
|
|
PyObject *call_args[] = { tmp_args_element_name_3 };
|
|
tmp_iter_arg_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_2, call_args );
|
|
}
|
|
|
|
Py_DECREF( tmp_called_name_2 );
|
|
if ( tmp_iter_arg_1 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
tmp_assign_source_5 = MAKE_ITERATOR( tmp_iter_arg_1 );
|
|
Py_DECREF( tmp_iter_arg_1 );
|
|
if ( tmp_assign_source_5 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
assert( tmp_for_loop_1__for_iterator == NULL );
|
|
tmp_for_loop_1__for_iterator = tmp_assign_source_5;
|
|
|
|
}
|
|
{
|
|
// Tried code:
|
|
{
|
|
loop_start_1:;
|
|
{
|
|
PyObject *tmp_next_source_1;
|
|
PyObject *tmp_assign_source_6;
|
|
CHECK_OBJECT( tmp_for_loop_1__for_iterator );
|
|
tmp_next_source_1 = tmp_for_loop_1__for_iterator;
|
|
tmp_assign_source_6 = ITERATOR_NEXT( tmp_next_source_1 );
|
|
if ( tmp_assign_source_6 == NULL )
|
|
{
|
|
if ( CHECK_AND_CLEAR_STOP_ITERATION_OCCURRED() )
|
|
{
|
|
|
|
goto loop_end_1;
|
|
}
|
|
else
|
|
{
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
type_description_1 = "oooooo";
|
|
exception_lineno = 14;
|
|
goto try_except_handler_2;
|
|
}
|
|
}
|
|
|
|
{
|
|
PyObject *old = tmp_for_loop_1__iter_value;
|
|
tmp_for_loop_1__iter_value = tmp_assign_source_6;
|
|
Py_XDECREF( old );
|
|
}
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_7;
|
|
CHECK_OBJECT( tmp_for_loop_1__iter_value );
|
|
tmp_assign_source_7 = tmp_for_loop_1__iter_value;
|
|
{
|
|
PyObject *old = var_name;
|
|
var_name = tmp_assign_source_7;
|
|
Py_INCREF( var_name );
|
|
Py_XDECREF( old );
|
|
}
|
|
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_8;
|
|
PyObject *tmp_called_name_3;
|
|
PyObject *tmp_source_name_4;
|
|
PyObject *tmp_source_name_5;
|
|
PyObject *tmp_args_element_name_4;
|
|
PyObject *tmp_args_element_name_5;
|
|
if ( var_os == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "os" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_source_name_5 = var_os;
|
|
tmp_source_name_4 = LOOKUP_ATTRIBUTE( tmp_source_name_5, const_str_plain_path );
|
|
if ( tmp_source_name_4 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
tmp_called_name_3 = LOOKUP_ATTRIBUTE( tmp_source_name_4, const_str_plain_join );
|
|
Py_DECREF( tmp_source_name_4 );
|
|
if ( tmp_called_name_3 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
if ( var_include_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_3 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "include_path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_args_element_name_4 = var_include_path;
|
|
if ( var_name == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_3 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "name" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_args_element_name_5 = var_name;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 15;
|
|
{
|
|
PyObject *call_args[] = { tmp_args_element_name_4, tmp_args_element_name_5 };
|
|
tmp_assign_source_8 = CALL_FUNCTION_WITH_ARGS2( tmp_called_name_3, call_args );
|
|
}
|
|
|
|
Py_DECREF( tmp_called_name_3 );
|
|
if ( tmp_assign_source_8 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 15;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
{
|
|
PyObject *old = var_path;
|
|
var_path = tmp_assign_source_8;
|
|
Py_XDECREF( old );
|
|
}
|
|
|
|
}
|
|
{
|
|
nuitka_bool tmp_condition_result_1;
|
|
PyObject *tmp_called_name_4;
|
|
PyObject *tmp_source_name_6;
|
|
PyObject *tmp_source_name_7;
|
|
PyObject *tmp_call_result_1;
|
|
PyObject *tmp_args_element_name_6;
|
|
int tmp_truth_name_1;
|
|
if ( var_os == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "os" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_source_name_7 = var_os;
|
|
tmp_source_name_6 = LOOKUP_ATTRIBUTE( tmp_source_name_7, const_str_plain_path );
|
|
if ( tmp_source_name_6 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
tmp_called_name_4 = LOOKUP_ATTRIBUTE( tmp_source_name_6, const_str_plain_isdir );
|
|
Py_DECREF( tmp_source_name_6 );
|
|
if ( tmp_called_name_4 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
if ( var_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_4 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_args_element_name_6 = var_path;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 16;
|
|
{
|
|
PyObject *call_args[] = { tmp_args_element_name_6 };
|
|
tmp_call_result_1 = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_4, call_args );
|
|
}
|
|
|
|
Py_DECREF( tmp_called_name_4 );
|
|
if ( tmp_call_result_1 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
tmp_truth_name_1 = CHECK_IF_TRUE( tmp_call_result_1 );
|
|
if ( tmp_truth_name_1 == -1 )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
Py_DECREF( tmp_call_result_1 );
|
|
|
|
exception_lineno = 16;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
tmp_condition_result_1 = tmp_truth_name_1 == 1 ? NUITKA_BOOL_TRUE : NUITKA_BOOL_FALSE;
|
|
Py_DECREF( tmp_call_result_1 );
|
|
if ( tmp_condition_result_1 == NUITKA_BOOL_TRUE )
|
|
{
|
|
goto branch_yes_1;
|
|
}
|
|
else
|
|
{
|
|
goto branch_no_1;
|
|
}
|
|
branch_yes_1:;
|
|
{
|
|
PyObject *tmp_called_name_5;
|
|
PyObject *tmp_source_name_8;
|
|
PyObject *tmp_args_element_name_7;
|
|
if ( var_includes == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "includes" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 17;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_source_name_8 = var_includes;
|
|
tmp_called_name_5 = LOOKUP_ATTRIBUTE( tmp_source_name_8, const_str_plain_append );
|
|
if ( tmp_called_name_5 == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 17;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
if ( var_path == NULL )
|
|
{
|
|
Py_DECREF( tmp_called_name_5 );
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "path" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 17;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
|
|
tmp_args_element_name_7 = var_path;
|
|
frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame.f_lineno = 17;
|
|
{
|
|
PyObject *call_args[] = { tmp_args_element_name_7 };
|
|
tmp_unused = CALL_FUNCTION_WITH_ARGS1( tmp_called_name_5, call_args );
|
|
}
|
|
|
|
Py_DECREF( tmp_called_name_5 );
|
|
if ( tmp_unused == NULL )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 17;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
Py_DECREF( tmp_unused );
|
|
}
|
|
branch_no_1:;
|
|
}
|
|
if ( CONSIDER_THREADING() == false )
|
|
{
|
|
assert( ERROR_OCCURRED() );
|
|
|
|
FETCH_ERROR_OCCURRED( &exception_type, &exception_value, &exception_tb );
|
|
|
|
|
|
exception_lineno = 14;
|
|
type_description_1 = "oooooo";
|
|
goto try_except_handler_2;
|
|
}
|
|
goto loop_start_1;
|
|
loop_end_1:;
|
|
}
|
|
goto try_end_1;
|
|
// Exception handler code:
|
|
try_except_handler_2:;
|
|
exception_keeper_type_1 = exception_type;
|
|
exception_keeper_value_1 = exception_value;
|
|
exception_keeper_tb_1 = exception_tb;
|
|
exception_keeper_lineno_1 = exception_lineno;
|
|
exception_type = NULL;
|
|
exception_value = NULL;
|
|
exception_tb = NULL;
|
|
exception_lineno = 0;
|
|
|
|
{
|
|
Py_XDECREF( tmp_for_loop_1__iter_value );
|
|
tmp_for_loop_1__iter_value = NULL;
|
|
|
|
}
|
|
{
|
|
CHECK_OBJECT( (PyObject *)tmp_for_loop_1__for_iterator );
|
|
Py_DECREF( tmp_for_loop_1__for_iterator );
|
|
tmp_for_loop_1__for_iterator = NULL;
|
|
|
|
}
|
|
{
|
|
// Re-raise.
|
|
exception_type = exception_keeper_type_1;
|
|
exception_value = exception_keeper_value_1;
|
|
exception_tb = exception_keeper_tb_1;
|
|
exception_lineno = exception_keeper_lineno_1;
|
|
|
|
goto frame_exception_exit_1;
|
|
}
|
|
// End of try:
|
|
try_end_1:;
|
|
}
|
|
{
|
|
Py_XDECREF( tmp_for_loop_1__iter_value );
|
|
tmp_for_loop_1__iter_value = NULL;
|
|
|
|
}
|
|
{
|
|
CHECK_OBJECT( (PyObject *)tmp_for_loop_1__for_iterator );
|
|
Py_DECREF( tmp_for_loop_1__for_iterator );
|
|
tmp_for_loop_1__for_iterator = NULL;
|
|
|
|
}
|
|
{
|
|
if ( var_includes == NULL )
|
|
{
|
|
|
|
exception_type = PyExc_UnboundLocalError;
|
|
Py_INCREF( exception_type );
|
|
exception_value = PyUnicode_FromFormat( "local variable '%s' referenced before assignment", "includes" );
|
|
exception_tb = NULL;
|
|
NORMALIZE_EXCEPTION( &exception_type, &exception_value, &exception_tb );
|
|
CHAIN_EXCEPTION( exception_value );
|
|
|
|
exception_lineno = 19;
|
|
type_description_1 = "oooooo";
|
|
goto frame_exception_exit_1;
|
|
}
|
|
|
|
tmp_return_value = var_includes;
|
|
Py_INCREF( tmp_return_value );
|
|
goto frame_return_exit_1;
|
|
}
|
|
|
|
#if 0
|
|
RESTORE_FRAME_EXCEPTION( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
#endif
|
|
|
|
// Put the previous frame back on top.
|
|
popFrameStack();
|
|
|
|
goto frame_no_exception_1;
|
|
|
|
frame_return_exit_1:;
|
|
#if 0
|
|
RESTORE_FRAME_EXCEPTION( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
#endif
|
|
|
|
// Put the previous frame back on top.
|
|
popFrameStack();
|
|
|
|
goto try_return_handler_1;
|
|
|
|
frame_exception_exit_1:;
|
|
|
|
#if 0
|
|
RESTORE_FRAME_EXCEPTION( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
#endif
|
|
|
|
if ( exception_tb == NULL )
|
|
{
|
|
exception_tb = MAKE_TRACEBACK( frame_c4b39b215000f4e40a68a71f12bf6ed7, exception_lineno );
|
|
}
|
|
else if ( exception_tb->tb_frame != &frame_c4b39b215000f4e40a68a71f12bf6ed7->m_frame )
|
|
{
|
|
exception_tb = ADD_TRACEBACK( exception_tb, frame_c4b39b215000f4e40a68a71f12bf6ed7, exception_lineno );
|
|
}
|
|
|
|
// Attachs locals to frame if any.
|
|
Nuitka_Frame_AttachLocals(
|
|
(struct Nuitka_FrameObject *)frame_c4b39b215000f4e40a68a71f12bf6ed7,
|
|
type_description_1,
|
|
var_os,
|
|
var_lxml_path,
|
|
var_include_path,
|
|
var_includes,
|
|
var_name,
|
|
var_path
|
|
);
|
|
|
|
|
|
// Release cached frame.
|
|
if ( frame_c4b39b215000f4e40a68a71f12bf6ed7 == cache_frame_c4b39b215000f4e40a68a71f12bf6ed7 )
|
|
{
|
|
Py_DECREF( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
}
|
|
cache_frame_c4b39b215000f4e40a68a71f12bf6ed7 = NULL;
|
|
|
|
assertFrameObject( frame_c4b39b215000f4e40a68a71f12bf6ed7 );
|
|
|
|
// Put the previous frame back on top.
|
|
popFrameStack();
|
|
|
|
// Return the error.
|
|
goto try_except_handler_1;
|
|
|
|
frame_no_exception_1:;
|
|
// tried codes exits in all cases
|
|
NUITKA_CANNOT_GET_HERE( lxml$$$function_1_get_include );
|
|
return NULL;
|
|
// Return handler code:
|
|
try_return_handler_1:;
|
|
{
|
|
Py_XDECREF( var_os );
|
|
var_os = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_lxml_path );
|
|
var_lxml_path = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_include_path );
|
|
var_include_path = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_includes );
|
|
var_includes = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_name );
|
|
var_name = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_path );
|
|
var_path = NULL;
|
|
|
|
}
|
|
{
|
|
goto function_return_exit;
|
|
}
|
|
// Exception handler code:
|
|
try_except_handler_1:;
|
|
exception_keeper_type_2 = exception_type;
|
|
exception_keeper_value_2 = exception_value;
|
|
exception_keeper_tb_2 = exception_tb;
|
|
exception_keeper_lineno_2 = exception_lineno;
|
|
exception_type = NULL;
|
|
exception_value = NULL;
|
|
exception_tb = NULL;
|
|
exception_lineno = 0;
|
|
|
|
{
|
|
Py_XDECREF( var_os );
|
|
var_os = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_lxml_path );
|
|
var_lxml_path = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_include_path );
|
|
var_include_path = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_includes );
|
|
var_includes = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_name );
|
|
var_name = NULL;
|
|
|
|
}
|
|
{
|
|
Py_XDECREF( var_path );
|
|
var_path = NULL;
|
|
|
|
}
|
|
{
|
|
// Re-raise.
|
|
exception_type = exception_keeper_type_2;
|
|
exception_value = exception_keeper_value_2;
|
|
exception_tb = exception_keeper_tb_2;
|
|
exception_lineno = exception_keeper_lineno_2;
|
|
|
|
goto function_exception_exit;
|
|
}
|
|
// End of try:
|
|
}
|
|
|
|
// Return statement must have exited already.
|
|
NUITKA_CANNOT_GET_HERE( lxml$$$function_1_get_include );
|
|
return NULL;
|
|
|
|
function_exception_exit:
|
|
assert( exception_type );
|
|
RESTORE_ERROR_OCCURRED( exception_type, exception_value, exception_tb );
|
|
|
|
return NULL;
|
|
function_return_exit:
|
|
|
|
CHECK_OBJECT( tmp_return_value );
|
|
assert( had_error || !ERROR_OCCURRED() );
|
|
return tmp_return_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PyObject *MAKE_FUNCTION_lxml$$$function_1_get_include( )
|
|
{
|
|
struct Nuitka_FunctionObject *result = Nuitka_Function_New(
|
|
impl_lxml$$$function_1_get_include,
|
|
const_str_plain_get_include,
|
|
#if PYTHON_VERSION >= 300
|
|
NULL,
|
|
#endif
|
|
codeobj_c4b39b215000f4e40a68a71f12bf6ed7,
|
|
NULL,
|
|
#if PYTHON_VERSION >= 300
|
|
NULL,
|
|
NULL,
|
|
#endif
|
|
module_lxml,
|
|
const_str_digest_9861d683770e66a4e951df5d78950a09,
|
|
0
|
|
);
|
|
|
|
return (PyObject *)result;
|
|
}
|
|
|
|
|
|
|
|
#if PYTHON_VERSION >= 300
|
|
static struct PyModuleDef mdef_lxml =
|
|
{
|
|
PyModuleDef_HEAD_INIT,
|
|
"lxml", /* m_name */
|
|
NULL, /* m_doc */
|
|
-1, /* m_size */
|
|
NULL, /* m_methods */
|
|
NULL, /* m_reload */
|
|
NULL, /* m_traverse */
|
|
NULL, /* m_clear */
|
|
NULL, /* m_free */
|
|
};
|
|
#endif
|
|
|
|
extern PyObject *const_str_plain___package__;
|
|
|
|
#if PYTHON_VERSION >= 300
|
|
extern PyObject *const_str_dot;
|
|
|
|
extern PyObject *const_str_plain___loader__;
|
|
extern PyObject *metapath_based_loader;
|
|
#endif
|
|
|
|
#if PYTHON_VERSION >= 340
|
|
extern PyObject *const_str_plain___spec__;
|
|
extern PyObject *const_str_plain__initializing;
|
|
#endif
|
|
|
|
extern void _initCompiledCellType();
|
|
extern void _initCompiledGeneratorType();
|
|
extern void _initCompiledFunctionType();
|
|
extern void _initCompiledMethodType();
|
|
extern void _initCompiledFrameType();
|
|
#if PYTHON_VERSION >= 350
|
|
extern void _initCompiledCoroutineTypes();
|
|
#endif
|
|
#if PYTHON_VERSION >= 360
|
|
extern void _initCompiledAsyncgenTypes();
|
|
#endif
|
|
|
|
// The exported interface to CPython. On import of the module, this function
|
|
// gets called. It has to have an exact function name, in cases it's a shared
|
|
// library export. This is hidden behind the MOD_INIT_DECL.
|
|
|
|
MOD_INIT_DECL( lxml )
|
|
{
|
|
#if defined(_NUITKA_EXE) || PYTHON_VERSION >= 300
|
|
static bool _init_done = false;
|
|
|
|
// Modules might be imported repeatedly, which is to be ignored.
|
|
if ( _init_done )
|
|
{
|
|
return MOD_RETURN_VALUE( module_lxml );
|
|
}
|
|
else
|
|
{
|
|
_init_done = true;
|
|
}
|
|
#endif
|
|
|
|
#ifdef _NUITKA_MODULE
|
|
// In case of a stand alone extension module, need to call initialization
|
|
// the init here because that's the first and only time we are going to get
|
|
// called here.
|
|
|
|
// Initialize the constant values used.
|
|
_initBuiltinModule();
|
|
createGlobalConstants();
|
|
|
|
/* Initialize the compiled types of Nuitka. */
|
|
_initCompiledCellType();
|
|
_initCompiledGeneratorType();
|
|
_initCompiledFunctionType();
|
|
_initCompiledMethodType();
|
|
_initCompiledFrameType();
|
|
#if PYTHON_VERSION >= 350
|
|
_initCompiledCoroutineTypes();
|
|
#endif
|
|
#if PYTHON_VERSION >= 360
|
|
_initCompiledAsyncgenTypes();
|
|
#endif
|
|
|
|
#if PYTHON_VERSION < 300
|
|
_initSlotCompare();
|
|
#endif
|
|
#if PYTHON_VERSION >= 270
|
|
_initSlotIternext();
|
|
#endif
|
|
|
|
patchBuiltinModule();
|
|
patchTypeComparison();
|
|
|
|
// Enable meta path based loader if not already done.
|
|
#ifdef _NUITKA_TRACE
|
|
puts("lxml: Calling setupMetaPathBasedLoader().");
|
|
#endif
|
|
setupMetaPathBasedLoader();
|
|
|
|
#if PYTHON_VERSION >= 300
|
|
patchInspectModule();
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/* The constants only used by this module are created now. */
|
|
#ifdef _NUITKA_TRACE
|
|
puts("lxml: Calling createModuleConstants().");
|
|
#endif
|
|
createModuleConstants();
|
|
|
|
/* The code objects used by this module are created now. */
|
|
#ifdef _NUITKA_TRACE
|
|
puts("lxml: Calling createModuleCodeObjects().");
|
|
#endif
|
|
createModuleCodeObjects();
|
|
|
|
// puts( "in initlxml" );
|
|
|
|
// Create the module object first. There are no methods initially, all are
|
|
// added dynamically in actual code only. Also no "__doc__" is initially
|
|
// set at this time, as it could not contain NUL characters this way, they
|
|
// are instead set in early module code. No "self" for modules, we have no
|
|
// use for it.
|
|
#if PYTHON_VERSION < 300
|
|
module_lxml = Py_InitModule4(
|
|
"lxml", // Module Name
|
|
NULL, // No methods initially, all are added
|
|
// dynamically in actual module code only.
|
|
NULL, // No "__doc__" is initially set, as it could
|
|
// not contain NUL this way, added early in
|
|
// actual code.
|
|
NULL, // No self for modules, we don't use it.
|
|
PYTHON_API_VERSION
|
|
);
|
|
#else
|
|
|
|
module_lxml = PyModule_Create( &mdef_lxml );
|
|
#endif
|
|
|
|
moduledict_lxml = MODULE_DICT( module_lxml );
|
|
|
|
// Update "__package__" value to what it ought to be.
|
|
{
|
|
#if 1
|
|
PyObject *module_name = GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___name__ );
|
|
|
|
UPDATE_STRING_DICT1(
|
|
moduledict_lxml,
|
|
(Nuitka_StringObject *)const_str_plain___package__,
|
|
module_name
|
|
);
|
|
|
|
#else
|
|
|
|
#if PYTHON_VERSION < 300
|
|
PyObject *module_name = GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___name__ );
|
|
char const *module_name_cstr = PyString_AS_STRING( module_name );
|
|
|
|
char const *last_dot = strrchr( module_name_cstr, '.' );
|
|
|
|
if ( last_dot != NULL )
|
|
{
|
|
UPDATE_STRING_DICT1(
|
|
moduledict_lxml,
|
|
(Nuitka_StringObject *)const_str_plain___package__,
|
|
PyString_FromStringAndSize( module_name_cstr, last_dot - module_name_cstr )
|
|
);
|
|
}
|
|
#else
|
|
PyObject *module_name = GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___name__ );
|
|
Py_ssize_t dot_index = PyUnicode_Find( module_name, const_str_dot, 0, PyUnicode_GetLength( module_name ), -1 );
|
|
|
|
if ( dot_index != -1 )
|
|
{
|
|
UPDATE_STRING_DICT1(
|
|
moduledict_lxml,
|
|
(Nuitka_StringObject *)const_str_plain___package__,
|
|
PyUnicode_Substring( module_name, 0, dot_index )
|
|
);
|
|
}
|
|
#endif
|
|
#endif
|
|
}
|
|
|
|
CHECK_OBJECT( module_lxml );
|
|
|
|
// Seems to work for Python2.7 out of the box, but for Python3, the module
|
|
// doesn't automatically enter "sys.modules", so do it manually.
|
|
#if PYTHON_VERSION >= 300
|
|
{
|
|
int r = PyObject_SetItem( PySys_GetObject( (char *)"modules" ), const_str_plain_lxml, module_lxml );
|
|
|
|
assert( r != -1 );
|
|
}
|
|
#endif
|
|
|
|
// For deep importing of a module we need to have "__builtins__", so we set
|
|
// it ourselves in the same way than CPython does. Note: This must be done
|
|
// before the frame object is allocated, or else it may fail.
|
|
|
|
if ( GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___builtins__ ) == NULL )
|
|
{
|
|
PyObject *value = (PyObject *)builtin_module;
|
|
|
|
// Check if main module, not a dict then but the module itself.
|
|
#if !defined(_NUITKA_EXE) || !0
|
|
value = PyModule_GetDict( value );
|
|
#endif
|
|
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___builtins__, value );
|
|
}
|
|
|
|
#if PYTHON_VERSION >= 300
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___loader__, metapath_based_loader );
|
|
#endif
|
|
|
|
#if PYTHON_VERSION >= 340
|
|
#if 0
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___spec__, Py_None );
|
|
#else
|
|
{
|
|
PyObject *bootstrap_module = PyImport_ImportModule("importlib._bootstrap");
|
|
CHECK_OBJECT( bootstrap_module );
|
|
PyObject *module_spec_class = PyObject_GetAttrString( bootstrap_module, "ModuleSpec" );
|
|
Py_DECREF( bootstrap_module );
|
|
|
|
PyObject *args[] = {
|
|
GET_STRING_DICT_VALUE( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___name__ ),
|
|
metapath_based_loader
|
|
};
|
|
|
|
PyObject *spec_value = CALL_FUNCTION_WITH_ARGS2(
|
|
module_spec_class,
|
|
args
|
|
);
|
|
|
|
SET_ATTRIBUTE( spec_value, const_str_plain__initializing, Py_True );
|
|
|
|
UPDATE_STRING_DICT1( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___spec__, spec_value );
|
|
|
|
Py_DECREF( module_spec_class );
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
// Temp variables if any
|
|
|
|
|
|
// Module code.
|
|
{
|
|
PyObject *tmp_assign_source_1;
|
|
tmp_assign_source_1 = Py_None;
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___doc__, tmp_assign_source_1 );
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_2;
|
|
tmp_assign_source_2 = const_str_digest_d42b72c5a79ad18c1a3d0766951e7e66;
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___file__, tmp_assign_source_2 );
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_3;
|
|
tmp_assign_source_3 = LIST_COPY( const_list_str_digest_902038a12cad885028a49bee17ed2177_list );
|
|
UPDATE_STRING_DICT1( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___path__, tmp_assign_source_3 );
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_4;
|
|
tmp_assign_source_4 = Py_None;
|
|
UPDATE_STRING_DICT0( moduledict_lxml, (Nuitka_StringObject *)const_str_plain___cached__, tmp_assign_source_4 );
|
|
}
|
|
{
|
|
PyObject *tmp_assign_source_5;
|
|
tmp_assign_source_5 = MAKE_FUNCTION_lxml$$$function_1_get_include( );
|
|
|
|
|
|
|
|
UPDATE_STRING_DICT1( moduledict_lxml, (Nuitka_StringObject *)const_str_plain_get_include, tmp_assign_source_5 );
|
|
}
|
|
|
|
return MOD_RETURN_VALUE( module_lxml );
|
|
}
|