Nuitka-winsvc 1.8.6__cp312-cp312-win_amd64.whl → 1.9.3__cp312-cp312-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/RECORD +212 -203
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/WHEEL +1 -1
- nuitka/BytecodeCaching.py +4 -1
- nuitka/HardImportRegistry.py +348 -0
- nuitka/MainControl.py +45 -25
- nuitka/OptionParsing.py +31 -20
- nuitka/Options.py +47 -16
- nuitka/Progress.py +32 -2
- nuitka/PythonFlavors.py +1 -1
- nuitka/PythonVersions.py +61 -0
- nuitka/Tracing.py +25 -12
- nuitka/TreeXML.py +5 -5
- nuitka/Variables.py +15 -24
- nuitka/Version.py +16 -6
- nuitka/__main__.py +15 -0
- nuitka/__past__.py +15 -17
- nuitka/build/Backend.scons +44 -35
- nuitka/build/CCompilerVersion.scons +10 -9
- nuitka/build/Onefile.scons +11 -26
- nuitka/build/SconsCaching.py +2 -0
- nuitka/build/SconsCompilerSettings.py +72 -22
- nuitka/build/SconsHacks.py +1 -0
- nuitka/build/SconsInterface.py +5 -0
- nuitka/build/SconsSpawn.py +16 -3
- nuitka/build/SconsUtils.py +11 -12
- nuitka/build/include/nuitka/checksum_tools.h +0 -4
- nuitka/build/include/nuitka/compiled_asyncgen.h +1 -1
- nuitka/build/include/nuitka/compiled_coroutine.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +7 -4
- nuitka/build/include/nuitka/compiled_function.h +13 -3
- nuitka/build/include/nuitka/compiled_generator.h +1 -1
- nuitka/build/include/nuitka/constants.h +2 -0
- nuitka/build/include/nuitka/environment_variables.h +45 -0
- nuitka/build/include/nuitka/exceptions.h +32 -4
- nuitka/build/include/nuitka/filesystem_paths.h +6 -1
- nuitka/build/include/nuitka/freelists.h +11 -1
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +3 -0
- nuitka/build/include/nuitka/helpers.h +2 -0
- nuitka/build/include/nuitka/importing.h +3 -0
- nuitka/build/include/nuitka/prelude.h +17 -6
- nuitka/build/include/nuitka/unfreezing.h +1 -1
- nuitka/build/inline_copy/bin/scons.py +14 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +41 -41
- nuitka/build/static_src/CompiledCodeHelpers.c +14 -7
- nuitka/build/static_src/CompiledCoroutineType.c +60 -51
- nuitka/build/static_src/CompiledFrameType.c +12 -12
- nuitka/build/static_src/CompiledFunctionType.c +149 -28
- nuitka/build/static_src/CompiledGeneratorType.c +64 -65
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +1 -1
- nuitka/build/static_src/CompiledMethodType.c +5 -3
- nuitka/build/static_src/HelperEnvironmentVariables.c +120 -0
- nuitka/build/static_src/HelpersAttributes.c +1 -1
- nuitka/build/static_src/HelpersBuiltin.c +1 -1
- nuitka/build/static_src/HelpersChecksumTools.c +19 -4
- nuitka/build/static_src/HelpersComparisonEq.c +4 -4
- nuitka/build/static_src/HelpersComparisonNe.c +4 -4
- nuitka/build/static_src/HelpersConstantsBlob.c +40 -23
- nuitka/build/static_src/HelpersDictionaries.c +3 -1
- nuitka/build/static_src/HelpersDictionariesGenerated.c +9 -9
- nuitka/build/static_src/HelpersFilesystemPaths.c +12 -2
- nuitka/build/static_src/HelpersImport.c +29 -1
- nuitka/build/static_src/HelpersImportHard.c +19 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +5 -4
- nuitka/build/static_src/HelpersPythonPgo.c +5 -5
- nuitka/build/static_src/HelpersSafeStrings.c +2 -1
- nuitka/build/static_src/HelpersStrings.c +12 -10
- nuitka/build/static_src/HelpersTypes.c +1 -1
- nuitka/build/static_src/InspectPatcher.c +3 -2
- nuitka/build/static_src/MainProgram.c +182 -214
- nuitka/build/static_src/MetaPathBasedLoader.c +36 -23
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +4 -2
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +38 -2
- nuitka/build/static_src/OnefileBootstrap.c +124 -93
- nuitka/code_generation/CodeGeneration.py +4 -2
- nuitka/code_generation/CodeObjectCodes.py +5 -1
- nuitka/code_generation/ConstantCodes.py +4 -0
- nuitka/code_generation/Contexts.py +111 -3
- nuitka/code_generation/DictCodes.py +5 -5
- nuitka/code_generation/FunctionCodes.py +4 -2
- nuitka/code_generation/GlobalConstants.py +10 -0
- nuitka/code_generation/ImportCodes.py +69 -33
- nuitka/code_generation/ModuleCodes.py +4 -1
- nuitka/code_generation/Namify.py +6 -5
- nuitka/code_generation/YieldCodes.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesModules.py +61 -95
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +2 -2
- nuitka/distutils/DistutilCommands.py +3 -0
- nuitka/finalizations/FinalizeMarkups.py +1 -1
- nuitka/freezer/DependsExe.py +2 -1
- nuitka/freezer/DllDependenciesPosix.py +11 -1
- nuitka/freezer/IncludedEntryPoints.py +54 -16
- nuitka/freezer/Onefile.py +7 -3
- nuitka/freezer/Standalone.py +39 -17
- nuitka/importing/Importing.py +195 -62
- nuitka/importing/PreloadedPackages.py +2 -1
- nuitka/importing/Recursion.py +98 -27
- nuitka/importing/StandardLibrary.py +7 -4
- nuitka/nodes/BuiltinOpenNodes.py +28 -1
- nuitka/nodes/BuiltinRangeNodes.py +2 -2
- nuitka/nodes/BuiltinSumNodes.py +1 -1
- nuitka/nodes/ChildrenHavingMixins.py +326 -2
- nuitka/nodes/HardImportNodesGenerated.py +141 -38
- nuitka/nodes/ImportHardNodes.py +0 -8
- nuitka/nodes/ImportNodes.py +267 -361
- nuitka/nodes/IterationHandles.py +36 -17
- nuitka/nodes/LocalsScopes.py +3 -1
- nuitka/nodes/NodeBases.py +8 -14
- nuitka/nodes/OperatorNodes.py +9 -9
- nuitka/nodes/OutlineNodes.py +3 -3
- nuitka/nodes/PackageMetadataNodes.py +19 -9
- nuitka/nodes/SliceNodes.py +1 -1
- nuitka/nodes/VariableAssignNodes.py +25 -15
- nuitka/nodes/VariableRefNodes.py +7 -7
- nuitka/nodes/YieldNodes.py +2 -2
- nuitka/nodes/shapes/BuiltinTypeShapes.py +81 -6
- nuitka/nodes/shapes/ShapeMixins.py +21 -0
- nuitka/nodes/shapes/StandardShapes.py +9 -3
- nuitka/optimizations/OptimizeBuiltinCalls.py +1 -1
- nuitka/optimizations/TraceCollections.py +75 -0
- nuitka/pgo/PGO.py +14 -6
- nuitka/plugins/PluginBase.py +83 -11
- nuitka/plugins/Plugins.py +78 -35
- nuitka/plugins/standard/AntiBloatPlugin.py +46 -1
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +1 -1
- nuitka/plugins/standard/DelvewheelPlugin.py +2 -1
- nuitka/plugins/standard/DillPlugin.py +3 -99
- nuitka/plugins/standard/DllFilesPlugin.py +45 -0
- nuitka/plugins/standard/GiPlugin.py +23 -10
- nuitka/plugins/standard/GlfwPlugin.py +1 -0
- nuitka/plugins/standard/ImplicitImports.py +267 -15
- nuitka/plugins/standard/KivyPlugin.py +1 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +43 -25
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -6
- nuitka/plugins/standard/PkgResourcesPlugin.py +1 -1
- nuitka/plugins/standard/PmwPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +37 -20
- nuitka/plugins/standard/TkinterPlugin.py +44 -30
- nuitka/plugins/standard/TransformersPlugin.py +3 -1
- nuitka/plugins/standard/standard.nuitka-package.config.yml +522 -86
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +8 -1
- nuitka/reports/CompilationReportReader.py +53 -0
- nuitka/reports/LicenseReport.rst.j2 +4 -4
- nuitka/reports/Reports.py +129 -47
- nuitka/specs/HardImportSpecs.py +6 -0
- nuitka/tools/data_composer/DataComposer.py +29 -17
- nuitka/tools/onefile_compressor/OnefileCompressor.py +173 -110
- nuitka/tools/podman/__main__.py +17 -2
- nuitka/tools/scanning/DisplayPackageDLLs.py +11 -2
- nuitka/tools/scanning/DisplayPackageData.py +1 -1
- nuitka/tools/specialize/CTypeDescriptions.py +36 -27
- nuitka/tools/specialize/SpecializeC.py +1 -1
- nuitka/tools/specialize/SpecializePython.py +16 -0
- nuitka/tools/testing/Common.py +3 -4
- nuitka/tools/testing/OutputComparison.py +23 -0
- nuitka/tools/testing/SearchModes.py +2 -2
- nuitka/tools/testing/compare_with_cpython/__main__.py +13 -4
- nuitka/tools/testing/measure_construct_performance/__main__.py +2 -5
- nuitka/tools/watch/__main__.py +194 -56
- nuitka/tree/Building.py +8 -2
- nuitka/tree/ComplexCallHelperFunctions.py +45 -15
- nuitka/tree/ReformulationAssignmentStatements.py +18 -12
- nuitka/tree/ReformulationCallExpressions.py +1 -1
- nuitka/tree/ReformulationClasses.py +11 -5
- nuitka/tree/ReformulationClasses3.py +30 -12
- nuitka/tree/ReformulationComparisonExpressions.py +4 -2
- nuitka/tree/ReformulationContractionExpressions.py +19 -11
- nuitka/tree/ReformulationDictionaryCreation.py +9 -3
- nuitka/tree/ReformulationExecStatements.py +6 -6
- nuitka/tree/ReformulationForLoopStatements.py +5 -5
- nuitka/tree/ReformulationFunctionStatements.py +6 -2
- nuitka/tree/ReformulationImportStatements.py +7 -2
- nuitka/tree/ReformulationLambdaExpressions.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +7 -3
- nuitka/tree/ReformulationPrintStatements.py +1 -1
- nuitka/tree/ReformulationSequenceCreation.py +18 -6
- nuitka/tree/ReformulationWithStatements.py +8 -8
- nuitka/tree/ReformulationYieldExpressions.py +2 -2
- nuitka/tree/SourceHandling.py +27 -5
- nuitka/tree/VariableClosure.py +11 -1
- nuitka/utils/AppDirs.py +2 -2
- nuitka/utils/CStrings.py +39 -3
- nuitka/utils/CommandLineOptions.py +42 -1
- nuitka/utils/Distributions.py +305 -38
- nuitka/utils/Download.py +27 -8
- nuitka/utils/FileOperations.py +103 -20
- nuitka/utils/Hashing.py +2 -3
- nuitka/utils/Importing.py +60 -3
- nuitka/utils/InstalledPythons.py +31 -36
- nuitka/utils/Jinja2.py +11 -5
- nuitka/utils/ModuleNames.py +11 -3
- nuitka/utils/ReExecute.py +7 -0
- nuitka/utils/SharedLibraries.py +38 -14
- nuitka/utils/SlotMetaClasses.py +55 -0
- nuitka/utils/Utils.py +10 -0
- nuitka/utils/Yaml.py +9 -1
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
- nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
- {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/top_level.txt +0 -0
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
#include "nuitka/freelists.h"
|
|
28
28
|
|
|
29
29
|
// Needed for offsetof
|
|
30
|
-
#include "structmember.h"
|
|
31
30
|
#include <stddef.h>
|
|
31
|
+
#include <structmember.h>
|
|
32
32
|
|
|
33
33
|
// spell-checker: ignore qualname,klass,kwdefaults,getset,weakrefs,vectorcall,nargsf,m_varnames
|
|
34
34
|
|
|
@@ -1007,6 +1007,127 @@ void Nuitka_Function_EnableConstReturnGeneric(struct Nuitka_FunctionObject *func
|
|
|
1007
1007
|
function->m_c_code = _Nuitka_FunctionEmptyCodeGenericImpl;
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
|
+
#ifdef _NUITKA_PLUGIN_DILL_ENABLED
|
|
1011
|
+
int Nuitka_Function_GetFunctionCodeIndex(struct Nuitka_FunctionObject *function,
|
|
1012
|
+
function_impl_code const *function_table) {
|
|
1013
|
+
|
|
1014
|
+
if (function->m_c_code == _Nuitka_FunctionEmptyCodeTrueImpl) {
|
|
1015
|
+
return -2;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if (function->m_c_code == _Nuitka_FunctionEmptyCodeFalseImpl) {
|
|
1019
|
+
return -3;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
if (function->m_c_code == _Nuitka_FunctionEmptyCodeNoneImpl) {
|
|
1023
|
+
return -4;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (function->m_c_code == _Nuitka_FunctionEmptyCodeGenericImpl) {
|
|
1027
|
+
return -5;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
function_impl_code const *current = function_table;
|
|
1031
|
+
int offset = 0;
|
|
1032
|
+
|
|
1033
|
+
while (*current != NULL) {
|
|
1034
|
+
if (*current == function->m_c_code) {
|
|
1035
|
+
break;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
current += 1;
|
|
1039
|
+
offset += 1;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
if (*current == NULL) {
|
|
1043
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1044
|
+
#if 0
|
|
1045
|
+
PRINT_STRING("Looking for:");
|
|
1046
|
+
PRINT_ITEM((PyObject *)function);
|
|
1047
|
+
PRINT_NEW_LINE();
|
|
1048
|
+
#endif
|
|
1049
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, "Cannot find compiled function in module.");
|
|
1050
|
+
return -1;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
return offset;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
struct Nuitka_FunctionObject *
|
|
1057
|
+
Nuitka_Function_CreateFunctionViaCodeIndex(PyObject *module, PyObject *function_qualname, PyObject *function_index,
|
|
1058
|
+
PyObject *code_object_desc, PyObject *constant_return_value,
|
|
1059
|
+
PyObject *defaults, PyObject *kw_defaults, PyObject *doc,
|
|
1060
|
+
function_impl_code const *function_table, int function_table_size) {
|
|
1061
|
+
int offset = PyLong_AsLong(function_index);
|
|
1062
|
+
|
|
1063
|
+
if (offset > function_table_size || offset < -5 || offset == -1) {
|
|
1064
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1065
|
+
|
|
1066
|
+
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, "Wrong offset for compiled function.");
|
|
1067
|
+
return NULL;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
PyObject *filename = PyTuple_GET_ITEM(code_object_desc, 0);
|
|
1071
|
+
PyObject *function_name = PyTuple_GET_ITEM(code_object_desc, 1);
|
|
1072
|
+
PyObject *line = PyTuple_GET_ITEM(code_object_desc, 2);
|
|
1073
|
+
int line_int = PyLong_AsLong(line);
|
|
1074
|
+
assert(line_int != -1);
|
|
1075
|
+
|
|
1076
|
+
PyObject *arg_names = PyTuple_GET_ITEM(code_object_desc, 3);
|
|
1077
|
+
PyObject *arg_count = PyTuple_GET_ITEM(code_object_desc, 4);
|
|
1078
|
+
int arg_count_int = PyLong_AsLong(arg_count);
|
|
1079
|
+
assert(arg_count_int != -1);
|
|
1080
|
+
|
|
1081
|
+
PyObject *flags = PyTuple_GET_ITEM(code_object_desc, 5);
|
|
1082
|
+
int flags_int = PyLong_AsLong(flags);
|
|
1083
|
+
assert(flags_int != -1);
|
|
1084
|
+
|
|
1085
|
+
PyCodeObject *code_object =
|
|
1086
|
+
MAKE_CODE_OBJECT(filename, line_int, flags_int, function_name, function_qualname, arg_names,
|
|
1087
|
+
NULL, // freevars
|
|
1088
|
+
arg_count_int,
|
|
1089
|
+
0, // TODO: Missing kw_only_count
|
|
1090
|
+
0 // TODO: Missing pos_only_count
|
|
1091
|
+
);
|
|
1092
|
+
|
|
1093
|
+
struct Nuitka_FunctionObject *result =
|
|
1094
|
+
Nuitka_Function_New(offset >= 0 ? function_table[offset] : NULL, code_object->co_name,
|
|
1095
|
+
#if PYTHON_VERSION >= 0x300
|
|
1096
|
+
NULL, // TODO: Not transferring qualname yet
|
|
1097
|
+
#endif
|
|
1098
|
+
code_object, defaults,
|
|
1099
|
+
#if PYTHON_VERSION >= 0x300
|
|
1100
|
+
kw_defaults,
|
|
1101
|
+
NULL, // TODO: Not transferring annotations
|
|
1102
|
+
#endif
|
|
1103
|
+
module, doc, NULL, 0);
|
|
1104
|
+
|
|
1105
|
+
CHECK_OBJECT(result);
|
|
1106
|
+
|
|
1107
|
+
if (offset == -2) {
|
|
1108
|
+
Nuitka_Function_EnableConstReturnTrue(result);
|
|
1109
|
+
}
|
|
1110
|
+
if (offset == -3) {
|
|
1111
|
+
Nuitka_Function_EnableConstReturnFalse(result);
|
|
1112
|
+
}
|
|
1113
|
+
if (offset == -4) {
|
|
1114
|
+
result->m_c_code = _Nuitka_FunctionEmptyCodeNoneImpl;
|
|
1115
|
+
}
|
|
1116
|
+
if (offset == -5) {
|
|
1117
|
+
CHECK_OBJECT(constant_return_value);
|
|
1118
|
+
|
|
1119
|
+
Nuitka_Function_EnableConstReturnGeneric(result, constant_return_value);
|
|
1120
|
+
|
|
1121
|
+
Py_INCREF(constant_return_value);
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
assert(result->m_c_code != NULL);
|
|
1125
|
+
|
|
1126
|
+
return result;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
#endif
|
|
1130
|
+
|
|
1010
1131
|
#if PYTHON_VERSION >= 0x380 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_VECTORCALL_SLOT)
|
|
1011
1132
|
static PyObject *Nuitka_Function_tp_vectorcall(struct Nuitka_FunctionObject *function, PyObject *const *stack,
|
|
1012
1133
|
size_t nargsf, PyObject *kw_names);
|
|
@@ -1019,7 +1140,7 @@ struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyO
|
|
|
1019
1140
|
struct Nuitka_CellObject **closure, Py_ssize_t closure_given)
|
|
1020
1141
|
#else
|
|
1021
1142
|
struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyObject *name, PyObject *qualname,
|
|
1022
|
-
PyCodeObject *code_object, PyObject *defaults, PyObject *
|
|
1143
|
+
PyCodeObject *code_object, PyObject *defaults, PyObject *kw_defaults,
|
|
1023
1144
|
PyObject *annotations, PyObject *module, PyObject *doc,
|
|
1024
1145
|
struct Nuitka_CellObject **closure, Py_ssize_t closure_given)
|
|
1025
1146
|
#endif
|
|
@@ -1065,8 +1186,8 @@ struct Nuitka_FunctionObject *Nuitka_Function_New(function_impl_code c_code, PyO
|
|
|
1065
1186
|
_onUpdatedCompiledFunctionDefaultsValue(result);
|
|
1066
1187
|
|
|
1067
1188
|
#if PYTHON_VERSION >= 0x300
|
|
1068
|
-
assert(
|
|
1069
|
-
result->m_kwdefaults =
|
|
1189
|
+
assert(kw_defaults == NULL || (PyDict_Check(kw_defaults) && DICT_SIZE(kw_defaults) > 0));
|
|
1190
|
+
result->m_kwdefaults = kw_defaults;
|
|
1070
1191
|
|
|
1071
1192
|
assert(annotations == NULL || (PyDict_Check(annotations) && DICT_SIZE(annotations) > 0));
|
|
1072
1193
|
result->m_annotations = annotations;
|
|
@@ -1357,11 +1478,11 @@ static void formatErrorTooFewKwOnlyArguments(PyThreadState *tstate, struct Nuitk
|
|
|
1357
1478
|
char const *function_name = Nuitka_String_AsString(function->m_qualname);
|
|
1358
1479
|
#endif
|
|
1359
1480
|
|
|
1360
|
-
Py_ssize_t
|
|
1481
|
+
Py_ssize_t co_kwonlyargcount = function->m_code_object->co_kwonlyargcount;
|
|
1361
1482
|
|
|
1362
1483
|
Py_ssize_t max_missing = 0;
|
|
1363
1484
|
|
|
1364
|
-
for (Py_ssize_t i =
|
|
1485
|
+
for (Py_ssize_t i = co_kwonlyargcount - 1; i >= 0; --i) {
|
|
1365
1486
|
if (kw_vars[i] == NULL) {
|
|
1366
1487
|
max_missing += 1;
|
|
1367
1488
|
}
|
|
@@ -1373,7 +1494,7 @@ static void formatErrorTooFewKwOnlyArguments(PyThreadState *tstate, struct Nuitk
|
|
|
1373
1494
|
PyObject *and_str = PyUnicode_FromString(max_missing == 2 ? " and " : ", and ");
|
|
1374
1495
|
|
|
1375
1496
|
Py_ssize_t missing = 0;
|
|
1376
|
-
for (Py_ssize_t i =
|
|
1497
|
+
for (Py_ssize_t i = co_kwonlyargcount - 1; i >= 0; --i) {
|
|
1377
1498
|
if (kw_vars[i] == NULL) {
|
|
1378
1499
|
PyObject *current_str = function->m_varnames[function->m_args_positional_count + i];
|
|
1379
1500
|
|
|
@@ -1519,10 +1640,10 @@ static Py_ssize_t handleKeywordArgs(PyThreadState *tstate, struct Nuitka_Functio
|
|
|
1519
1640
|
}
|
|
1520
1641
|
|
|
1521
1642
|
if (found == false) {
|
|
1522
|
-
PyObject **
|
|
1643
|
+
PyObject **var_names = function->m_varnames;
|
|
1523
1644
|
|
|
1524
1645
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
1525
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
1646
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
1526
1647
|
assert(python_pars[i] == NULL);
|
|
1527
1648
|
python_pars[i] = value;
|
|
1528
1649
|
|
|
@@ -1542,9 +1663,9 @@ static Py_ssize_t handleKeywordArgs(PyThreadState *tstate, struct Nuitka_Functio
|
|
|
1542
1663
|
bool pos_only_error = false;
|
|
1543
1664
|
|
|
1544
1665
|
for (Py_ssize_t i = 0; i < kw_arg_start; i++) {
|
|
1545
|
-
PyObject **
|
|
1666
|
+
PyObject **var_names = function->m_varnames;
|
|
1546
1667
|
|
|
1547
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
1668
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
1548
1669
|
pos_only_error = true;
|
|
1549
1670
|
break;
|
|
1550
1671
|
}
|
|
@@ -1633,11 +1754,11 @@ static Py_ssize_t handleKeywordArgsSplit(struct Nuitka_FunctionObject const *fun
|
|
|
1633
1754
|
}
|
|
1634
1755
|
|
|
1635
1756
|
if (found == false) {
|
|
1636
|
-
PyObject **
|
|
1757
|
+
PyObject **var_names = function->m_varnames;
|
|
1637
1758
|
|
|
1638
1759
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
1639
1760
|
// TODO: Could do better here, STR/UNICODE key knowledge being there.
|
|
1640
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
1761
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
1641
1762
|
assert(python_pars[i] == NULL);
|
|
1642
1763
|
python_pars[i] = value;
|
|
1643
1764
|
|
|
@@ -1657,9 +1778,9 @@ static Py_ssize_t handleKeywordArgsSplit(struct Nuitka_FunctionObject const *fun
|
|
|
1657
1778
|
bool pos_only_error = false;
|
|
1658
1779
|
|
|
1659
1780
|
for (Py_ssize_t i = 0; i < kw_arg_start; i++) {
|
|
1660
|
-
PyObject **
|
|
1781
|
+
PyObject **var_names = function->m_varnames;
|
|
1661
1782
|
|
|
1662
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
1783
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
1663
1784
|
pos_only_error = true;
|
|
1664
1785
|
break;
|
|
1665
1786
|
}
|
|
@@ -1735,7 +1856,7 @@ static Py_ssize_t handleKeywordArgsWithStarDict(PyThreadState *tstate, struct Nu
|
|
|
1735
1856
|
|
|
1736
1857
|
Py_ssize_t star_dict_index = function->m_args_star_dict_index;
|
|
1737
1858
|
|
|
1738
|
-
PyObject **
|
|
1859
|
+
PyObject **var_names = function->m_varnames;
|
|
1739
1860
|
|
|
1740
1861
|
#if PYTHON_VERSION < 0x380
|
|
1741
1862
|
Py_ssize_t kw_arg_start = 0;
|
|
@@ -1744,7 +1865,7 @@ static Py_ssize_t handleKeywordArgsWithStarDict(PyThreadState *tstate, struct Nu
|
|
|
1744
1865
|
#endif
|
|
1745
1866
|
|
|
1746
1867
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
1747
|
-
PyObject *arg_name =
|
|
1868
|
+
PyObject *arg_name = var_names[i];
|
|
1748
1869
|
|
|
1749
1870
|
PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);
|
|
1750
1871
|
|
|
@@ -1800,7 +1921,7 @@ static Py_ssize_t handleKeywordArgsSplitWithStarDict(PyThreadState *tstate,
|
|
|
1800
1921
|
Py_ssize_t keyword_after_index = function->m_args_positional_count;
|
|
1801
1922
|
#endif
|
|
1802
1923
|
|
|
1803
|
-
PyObject **
|
|
1924
|
+
PyObject **var_names = function->m_varnames;
|
|
1804
1925
|
|
|
1805
1926
|
#if PYTHON_VERSION < 0x380
|
|
1806
1927
|
Py_ssize_t kw_arg_start = 0;
|
|
@@ -1809,7 +1930,7 @@ static Py_ssize_t handleKeywordArgsSplitWithStarDict(PyThreadState *tstate,
|
|
|
1809
1930
|
#endif
|
|
1810
1931
|
|
|
1811
1932
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
1812
|
-
PyObject *arg_name =
|
|
1933
|
+
PyObject *arg_name = var_names[i];
|
|
1813
1934
|
|
|
1814
1935
|
PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);
|
|
1815
1936
|
|
|
@@ -2611,10 +2732,10 @@ static Py_ssize_t _handleVectorcallKeywordArgs(PyThreadState *tstate, struct Nui
|
|
|
2611
2732
|
}
|
|
2612
2733
|
|
|
2613
2734
|
if (found == false) {
|
|
2614
|
-
PyObject **
|
|
2735
|
+
PyObject **var_names = function->m_varnames;
|
|
2615
2736
|
|
|
2616
2737
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
2617
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
2738
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
2618
2739
|
assert(python_pars[i] == NULL);
|
|
2619
2740
|
python_pars[i] = kw_values[pos];
|
|
2620
2741
|
Py_INCREF(python_pars[i]);
|
|
@@ -2633,9 +2754,9 @@ static Py_ssize_t _handleVectorcallKeywordArgs(PyThreadState *tstate, struct Nui
|
|
|
2633
2754
|
bool pos_only_error = false;
|
|
2634
2755
|
|
|
2635
2756
|
for (Py_ssize_t i = 0; i < kw_arg_start; i++) {
|
|
2636
|
-
PyObject **
|
|
2757
|
+
PyObject **var_names = function->m_varnames;
|
|
2637
2758
|
|
|
2638
|
-
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(
|
|
2759
|
+
if (RICH_COMPARE_EQ_CBOOL_ARG_NAMES(var_names[i], key)) {
|
|
2639
2760
|
pos_only_error = true;
|
|
2640
2761
|
break;
|
|
2641
2762
|
}
|
|
@@ -2710,7 +2831,7 @@ static Py_ssize_t handleVectorcallKeywordArgsWithStarDict(PyThreadState *tstate,
|
|
|
2710
2831
|
|
|
2711
2832
|
Py_ssize_t star_dict_index = function->m_args_star_dict_index;
|
|
2712
2833
|
|
|
2713
|
-
PyObject **
|
|
2834
|
+
PyObject **var_names = function->m_varnames;
|
|
2714
2835
|
|
|
2715
2836
|
#if PYTHON_VERSION < 0x380
|
|
2716
2837
|
Py_ssize_t kw_arg_start = 0;
|
|
@@ -2719,7 +2840,7 @@ static Py_ssize_t handleVectorcallKeywordArgsWithStarDict(PyThreadState *tstate,
|
|
|
2719
2840
|
#endif
|
|
2720
2841
|
|
|
2721
2842
|
for (Py_ssize_t i = kw_arg_start; i < keywords_count; i++) {
|
|
2722
|
-
PyObject *arg_name =
|
|
2843
|
+
PyObject *arg_name = var_names[i];
|
|
2723
2844
|
|
|
2724
2845
|
PyObject *kw_arg_value = DICT_GET_ITEM1(tstate, python_pars[star_dict_index], arg_name);
|
|
2725
2846
|
|
|
@@ -2894,15 +3015,15 @@ static PyObject *Nuitka_Function_tp_call(struct Nuitka_FunctionObject *function,
|
|
|
2894
3015
|
static PyObject *Nuitka_Function_tp_vectorcall(struct Nuitka_FunctionObject *function, PyObject *const *stack,
|
|
2895
3016
|
size_t nargsf, PyObject *kw_names) {
|
|
2896
3017
|
assert(kw_names == NULL || PyTuple_CheckExact(kw_names));
|
|
2897
|
-
Py_ssize_t
|
|
3018
|
+
Py_ssize_t kwargs_count = (kw_names == NULL) ? 0 : PyTuple_GET_SIZE(kw_names);
|
|
2898
3019
|
|
|
2899
3020
|
Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
|
2900
3021
|
assert(nargs >= 0);
|
|
2901
|
-
assert((nargs == 0 &&
|
|
3022
|
+
assert((nargs == 0 && kwargs_count == 0) || stack != NULL);
|
|
2902
3023
|
|
|
2903
3024
|
PyThreadState *tstate = PyThreadState_GET();
|
|
2904
3025
|
return Nuitka_CallFunctionVectorcall(tstate, function, stack, nargs,
|
|
2905
|
-
kw_names ? &PyTuple_GET_ITEM(kw_names, 0) : NULL,
|
|
3026
|
+
kw_names ? &PyTuple_GET_ITEM(kw_names, 0) : NULL, kwargs_count);
|
|
2906
3027
|
}
|
|
2907
3028
|
#endif
|
|
2908
3029
|
|