Nuitka-winsvc 2.4.8__cp311-cp311-win_amd64.whl → 2.5.1__cp311-cp311-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.
Potentially problematic release.
This version of Nuitka-winsvc might be problematic. Click here for more details.
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +2 -1
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/RECORD +294 -271
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/WHEEL +1 -1
- nuitka/Builtins.py +31 -0
- nuitka/HardImportRegistry.py +8 -0
- nuitka/MainControl.py +9 -4
- nuitka/OptionParsing.py +105 -52
- nuitka/Options.py +73 -16
- nuitka/OutputDirectories.py +7 -2
- nuitka/PostProcessing.py +69 -38
- nuitka/Progress.py +16 -1
- nuitka/PythonVersions.py +2 -1
- nuitka/Serialization.py +4 -2
- nuitka/Tracing.py +69 -1
- nuitka/Version.py +2 -2
- nuitka/build/Backend.scons +45 -5
- nuitka/build/CCompilerVersion.scons +6 -0
- nuitka/build/Onefile.scons +6 -0
- nuitka/build/SconsCaching.py +12 -2
- nuitka/build/SconsCompilerSettings.py +17 -6
- nuitka/build/SconsInterface.py +1 -0
- nuitka/build/SconsUtils.py +5 -0
- nuitka/build/include/nuitka/allocator.h +124 -1
- nuitka/build/include/nuitka/calling.h +6 -6
- nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
- nuitka/build/include/nuitka/compiled_frame.h +2 -1
- nuitka/build/include/nuitka/constants.h +6 -0
- nuitka/build/include/nuitka/debug_settings.h +60 -0
- nuitka/build/include/nuitka/exceptions.h +264 -121
- nuitka/build/include/nuitka/helper/attributes.h +0 -4
- nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
- nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
- nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
- nuitka/build/include/nuitka/helper/dictionaries.h +65 -29
- nuitka/build/include/nuitka/helper/ints.h +86 -37
- nuitka/build/include/nuitka/helper/iterators.h +82 -34
- nuitka/build/include/nuitka/helper/operations.h +3 -0
- nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
- nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
- nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
- nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
- nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
- nuitka/build/include/nuitka/helper/raising.h +47 -28
- nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
- nuitka/build/include/nuitka/helpers.h +12 -2
- nuitka/build/include/nuitka/prelude.h +35 -25
- nuitka/build/include/nuitka/printing.h +9 -7
- nuitka/build/include/nuitka/threading.h +15 -1
- nuitka/build/include/nuitka/type_aliases.h +3 -0
- nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
- nuitka/build/inline_copy/stubgen/six.py +998 -0
- nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
- nuitka/build/static_src/CompiledCellType.c +6 -4
- nuitka/build/static_src/CompiledCodeHelpers.c +104 -40
- nuitka/build/static_src/CompiledCoroutineType.c +40 -30
- nuitka/build/static_src/CompiledFrameType.c +110 -79
- nuitka/build/static_src/CompiledFunctionType.c +173 -151
- nuitka/build/static_src/CompiledGeneratorType.c +51 -49
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +424 -46
- nuitka/build/static_src/CompiledMethodType.c +10 -13
- nuitka/build/static_src/HelpersAllocator.c +270 -32
- nuitka/build/static_src/HelpersAttributes.c +0 -21
- nuitka/build/static_src/HelpersBuiltin.c +22 -13
- nuitka/build/static_src/HelpersCalling.c +7 -7
- nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
- nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
- nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
- nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
- nuitka/build/static_src/HelpersComparisonEq.c +18 -4
- nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -0
- nuitka/build/static_src/HelpersComparisonGe.c +18 -4
- nuitka/build/static_src/HelpersComparisonGt.c +18 -4
- nuitka/build/static_src/HelpersComparisonLe.c +18 -4
- nuitka/build/static_src/HelpersComparisonLt.c +18 -4
- nuitka/build/static_src/HelpersComparisonNe.c +18 -4
- nuitka/build/static_src/HelpersConsole.c +34 -8
- nuitka/build/static_src/HelpersConstantsBlob.c +10 -4
- nuitka/build/static_src/HelpersDictionaries.c +181 -34
- nuitka/build/static_src/HelpersDictionariesGenerated.c +0 -106
- nuitka/build/static_src/HelpersExceptions.c +24 -50
- nuitka/build/static_src/HelpersFiles.c +79 -5
- nuitka/build/static_src/HelpersImport.c +13 -9
- nuitka/build/static_src/HelpersImportHard.c +23 -46
- nuitka/build/static_src/HelpersLists.c +98 -9
- nuitka/build/static_src/HelpersMatching.c +1 -1
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
- nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
- nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
- nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
- nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
- nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
- nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
- nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
- nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
- nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
- nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
- nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
- nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
- nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
- nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
- nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
- nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
- nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
- nuitka/build/static_src/HelpersProfiling.c +1 -1
- nuitka/build/static_src/HelpersRaising.c +255 -310
- nuitka/build/static_src/HelpersStrings.c +1 -1
- nuitka/build/static_src/HelpersTuples.c +1 -1
- nuitka/build/static_src/HelpersTypes.c +98 -2
- nuitka/build/static_src/MainProgram.c +117 -29
- nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
- nuitka/build/static_src/OnefileBootstrap.c +6 -1
- nuitka/code_generation/AsyncgenCodes.py +2 -6
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
- nuitka/code_generation/BuiltinCodes.py +9 -1
- nuitka/code_generation/CallCodes.py +16 -16
- nuitka/code_generation/CodeGeneration.py +14 -2
- nuitka/code_generation/CodeHelperSelection.py +1 -1
- nuitka/code_generation/CodeHelpers.py +4 -1
- nuitka/code_generation/CodeObjectCodes.py +2 -2
- nuitka/code_generation/ComparisonCodes.py +13 -2
- nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
- nuitka/code_generation/Contexts.py +28 -16
- nuitka/code_generation/CoroutineCodes.py +2 -6
- nuitka/code_generation/DictCodes.py +3 -3
- nuitka/code_generation/ErrorCodes.py +34 -50
- nuitka/code_generation/ExceptionCodes.py +165 -96
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
- nuitka/code_generation/FrameCodes.py +4 -11
- nuitka/code_generation/FunctionCodes.py +2 -6
- nuitka/code_generation/GeneratorCodes.py +2 -6
- nuitka/code_generation/GlobalConstants.py +8 -2
- nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
- nuitka/code_generation/IteratorCodes.py +67 -54
- nuitka/code_generation/LineNumberCodes.py +1 -3
- nuitka/code_generation/ModuleCodes.py +28 -4
- nuitka/code_generation/OperationCodes.py +51 -20
- nuitka/code_generation/PackageResourceCodes.py +37 -0
- nuitka/code_generation/RaisingCodes.py +164 -90
- nuitka/code_generation/Reports.py +13 -5
- nuitka/code_generation/ReturnCodes.py +2 -16
- nuitka/code_generation/TryCodes.py +12 -24
- nuitka/code_generation/TypeAliasCodes.py +48 -0
- nuitka/code_generation/VariableCodes.py +99 -40
- nuitka/code_generation/VariableDeclarations.py +8 -8
- nuitka/code_generation/YieldCodes.py +1 -1
- nuitka/code_generation/c_types/CTypeBases.py +10 -2
- nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
- nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
- nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
- nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
- nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
- nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
- nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
- nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
- nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
- nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
- nuitka/code_generation/templates/CodeTemplatesVariables.py +73 -0
- nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
- nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +0 -105
- nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
- nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
- nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
- nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
- nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
- nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
- nuitka/containers/Namedtuples.py +6 -0
- nuitka/containers/OrderedSets.py +105 -5
- nuitka/distutils/Build.py +14 -0
- nuitka/distutils/DistutilCommands.py +50 -10
- nuitka/finalizations/Finalization.py +3 -3
- nuitka/finalizations/FinalizeMarkups.py +10 -14
- nuitka/freezer/DependsExe.py +13 -3
- nuitka/freezer/DllDependenciesMacOS.py +18 -1
- nuitka/freezer/DllDependenciesWin32.py +26 -12
- nuitka/freezer/ImportDetection.py +3 -0
- nuitka/freezer/IncludedDataFiles.py +31 -8
- nuitka/freezer/IncludedEntryPoints.py +3 -2
- nuitka/freezer/Standalone.py +76 -18
- nuitka/importing/Importing.py +33 -6
- nuitka/importing/Recursion.py +12 -1
- nuitka/importing/StandardLibrary.py +57 -59
- nuitka/nodes/AsyncgenNodes.py +3 -6
- nuitka/nodes/BuiltinIteratorNodes.py +1 -1
- nuitka/nodes/BuiltinRefNodes.py +14 -30
- nuitka/nodes/ChildrenHavingMixins.py +439 -46
- nuitka/nodes/ConditionalNodes.py +3 -2
- nuitka/nodes/CoroutineNodes.py +3 -6
- nuitka/nodes/ExceptionNodes.py +102 -26
- nuitka/nodes/ExpressionBasesGenerated.py +288 -4
- nuitka/nodes/FrameNodes.py +22 -11
- nuitka/nodes/FunctionNodes.py +3 -3
- nuitka/nodes/GeneratorNodes.py +3 -6
- nuitka/nodes/HardImportNodesGenerated.py +182 -0
- nuitka/nodes/ImportNodes.py +2 -2
- nuitka/nodes/NodeBases.py +28 -1
- nuitka/nodes/NodeMakingHelpers.py +71 -50
- nuitka/nodes/OperatorNodesUnary.py +128 -3
- nuitka/nodes/OsSysNodes.py +37 -6
- nuitka/nodes/OutlineNodes.py +2 -2
- nuitka/nodes/StatementBasesGenerated.py +0 -2
- nuitka/nodes/StatementNodes.py +8 -7
- nuitka/nodes/SubscriptNodes.py +1 -1
- nuitka/nodes/TypeNodes.py +28 -1
- nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
- nuitka/nodes/shapes/ShapeMixins.py +17 -0
- nuitka/nodes/shapes/StandardShapes.py +53 -1
- nuitka/optimizations/BytecodeDemotion.py +2 -1
- nuitka/plugins/PluginBase.py +64 -22
- nuitka/plugins/Plugins.py +6 -3
- nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
- nuitka/plugins/standard/ImplicitImports.py +1 -13
- nuitka/plugins/standard/KivyPlugin.py +3 -12
- nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
- nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
- nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
- nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
- nuitka/plugins/standard/TkinterPlugin.py +0 -56
- nuitka/plugins/standard/TransformersPlugin.py +70 -275
- nuitka/plugins/standard/standard.nuitka-package.config.yml +510 -28
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
- nuitka/reports/CompilationReportReader.py +12 -0
- nuitka/reports/Reports.py +11 -0
- nuitka/specs/BuiltinParameterSpecs.py +5 -1
- nuitka/specs/HardImportSpecs.py +7 -0
- nuitka/specs/ParameterSpecs.py +4 -4
- nuitka/tools/general/dll_report/__main__.py +10 -1
- nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
- nuitka/tools/specialize/CTypeDescriptions.py +158 -9
- nuitka/tools/specialize/SpecializeC.py +218 -56
- nuitka/tools/testing/Common.py +70 -63
- nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
- nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
- nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
- nuitka/tools/watch/AutoStage.py +1 -0
- nuitka/tree/Building.py +10 -37
- nuitka/tree/ComplexCallHelperFunctions.py +4 -0
- nuitka/tree/ReformulationAssertStatements.py +31 -14
- nuitka/tree/ReformulationAssignmentStatements.py +5 -1
- nuitka/tree/ReformulationClasses3.py +94 -19
- nuitka/tree/ReformulationDictionaryCreation.py +1 -0
- nuitka/tree/ReformulationFunctionStatements.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationYieldExpressions.py +23 -5
- nuitka/utils/CommandLineOptions.py +27 -3
- nuitka/utils/Download.py +2 -2
- nuitka/utils/Execution.py +36 -31
- nuitka/utils/FileOperations.py +39 -54
- nuitka/utils/Importing.py +2 -14
- nuitka/utils/InlineCopies.py +52 -0
- nuitka/utils/InstalledPythons.py +9 -4
- nuitka/utils/Json.py +2 -2
- nuitka/utils/PackageResources.py +44 -0
- nuitka/utils/Utils.py +17 -0
- {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka-run.cmd +0 -0
- {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka.cmd +0 -0
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/top_level.txt +0 -0
|
@@ -86,7 +86,7 @@ static PyObject *_BUILTIN_RANGE_INT3(long low, long high, long step) {
|
|
|
86
86
|
long current = low;
|
|
87
87
|
|
|
88
88
|
for (int i = 0; i < size; i++) {
|
|
89
|
-
PyList_SET_ITEM(result, i,
|
|
89
|
+
PyList_SET_ITEM(result, i, Nuitka_PyInt_FromLong(current));
|
|
90
90
|
current += step;
|
|
91
91
|
}
|
|
92
92
|
|
|
@@ -99,7 +99,7 @@ static PyObject *_BUILTIN_RANGE_INT(long boundary) {
|
|
|
99
99
|
PyObject *result = MAKE_LIST_EMPTY(tstate, boundary > 0 ? boundary : 0);
|
|
100
100
|
|
|
101
101
|
for (int i = 0; i < boundary; i++) {
|
|
102
|
-
PyList_SET_ITEM(result, i,
|
|
102
|
+
PyList_SET_ITEM(result, i, Nuitka_PyInt_FromLong(i));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
return result;
|
|
@@ -194,7 +194,7 @@ PyObject *BUILTIN_RANGE2(PyThreadState *tstate, PyObject *low, PyObject *high) {
|
|
|
194
194
|
PyObject *pos_args = MAKE_TUPLE2_0(tstate, low_temp, high_temp);
|
|
195
195
|
NUITKA_ASSIGN_BUILTIN(range);
|
|
196
196
|
|
|
197
|
-
PyObject *result =
|
|
197
|
+
PyObject *result = CALL_FUNCTION_WITH_POS_ARGS2(tstate, NUITKA_ACCESS_BUILTIN(range), pos_args);
|
|
198
198
|
|
|
199
199
|
Py_DECREF(pos_args);
|
|
200
200
|
|
|
@@ -254,7 +254,7 @@ PyObject *BUILTIN_RANGE3(PyThreadState *tstate, PyObject *low, PyObject *high, P
|
|
|
254
254
|
|
|
255
255
|
NUITKA_ASSIGN_BUILTIN(range);
|
|
256
256
|
|
|
257
|
-
PyObject *result =
|
|
257
|
+
PyObject *result = CALL_FUNCTION_WITH_POS_ARGS3(tstate, NUITKA_ACCESS_BUILTIN(range), pos_args);
|
|
258
258
|
|
|
259
259
|
Py_DECREF(pos_args);
|
|
260
260
|
|
|
@@ -301,6 +301,8 @@ PyObject *MAKE_XRANGE(PyThreadState *tstate, long start, long stop, long step) {
|
|
|
301
301
|
return NULL;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
+
// spell-checker: ignore rangeobject
|
|
305
|
+
|
|
304
306
|
struct _rangeobject2 *result = (struct _rangeobject2 *)PyObject_New(struct _rangeobject2, &PyRange_Type);
|
|
305
307
|
assert(result != NULL);
|
|
306
308
|
|
|
@@ -674,7 +676,7 @@ PyObject *BUILTIN_FORMAT(PyThreadState *tstate, PyObject *value, PyObject *forma
|
|
|
674
676
|
}
|
|
675
677
|
|
|
676
678
|
// Helper functions for print. Need to play nice with Python softspace
|
|
677
|
-
// behavior.
|
|
679
|
+
// behavior. spell-checker: ignore softspace
|
|
678
680
|
|
|
679
681
|
#if PYTHON_VERSION >= 0x300
|
|
680
682
|
NUITKA_DEFINE_BUILTIN(print);
|
|
@@ -724,7 +726,7 @@ bool PRINT_NEW_LINE_TO(PyObject *file) {
|
|
|
724
726
|
|
|
725
727
|
// TODO: This should use something that does not build a dictionary at all, and not
|
|
726
728
|
// uses a tuple.
|
|
727
|
-
result =
|
|
729
|
+
result = CALL_FUNCTION_WITH_KW_ARGS(tstate, NUITKA_ACCESS_BUILTIN(print), kw_args);
|
|
728
730
|
|
|
729
731
|
Py_DECREF(kw_args);
|
|
730
732
|
}
|
|
@@ -836,7 +838,7 @@ void PRINT_REFCOUNT(PyObject *object) {
|
|
|
836
838
|
if (object) {
|
|
837
839
|
#if PYTHON_VERSION >= 0x3c0
|
|
838
840
|
if (_Py_IsImmortal(object)) {
|
|
839
|
-
PRINT_STRING("
|
|
841
|
+
PRINT_STRING(" refcnt IMMORTAL");
|
|
840
842
|
return;
|
|
841
843
|
}
|
|
842
844
|
#endif
|
|
@@ -915,38 +917,43 @@ bool PRINT_NULL(void) { return PRINT_STRING("<NULL>"); }
|
|
|
915
917
|
|
|
916
918
|
bool PRINT_TYPE(PyObject *object) { return PRINT_ITEM((PyObject *)Py_TYPE(object)); }
|
|
917
919
|
|
|
918
|
-
|
|
919
|
-
void _PRINT_EXCEPTION(PyObject *exception_type, PyObject *exception_value, PyTracebackObject *exception_tb) {
|
|
920
|
-
#else
|
|
921
|
-
void _PRINT_EXCEPTION(PyObject *exception_value) {
|
|
922
|
-
PyObject *exception_type = exception_value ? PyExceptionInstance_Class(exception_value) : NULL;
|
|
923
|
-
PyTracebackObject *exception_tb = (exception_value && PyExceptionInstance_Check(exception_value))
|
|
924
|
-
? GET_EXCEPTION_TRACEBACK(exception_value)
|
|
925
|
-
: NULL;
|
|
926
|
-
#endif
|
|
920
|
+
void _PRINT_EXCEPTION3(PyObject *exception_type, PyObject *exception_value, PyTracebackObject *exception_tb) {
|
|
927
921
|
PRINT_REPR(exception_type);
|
|
928
|
-
if (exception_type) {
|
|
922
|
+
if (exception_type != NULL) {
|
|
929
923
|
PRINT_REFCOUNT(exception_type);
|
|
930
924
|
}
|
|
931
925
|
PRINT_STRING("|");
|
|
932
926
|
PRINT_REPR(exception_value);
|
|
933
|
-
if (exception_value) {
|
|
927
|
+
if (exception_value != NULL) {
|
|
934
928
|
PRINT_REFCOUNT(exception_value);
|
|
935
929
|
}
|
|
936
930
|
#if PYTHON_VERSION >= 0x300
|
|
937
931
|
if (exception_value != NULL && PyExceptionInstance_Check(exception_value)) {
|
|
938
932
|
PRINT_STRING(" <- context ");
|
|
939
|
-
PyObject *context =
|
|
933
|
+
PyObject *context = Nuitka_Exception_GetContext(exception_value);
|
|
940
934
|
PRINT_REPR(context);
|
|
941
|
-
Py_XDECREF(context);
|
|
942
935
|
}
|
|
943
936
|
#endif
|
|
944
937
|
PRINT_STRING("|");
|
|
945
938
|
PRINT_REPR((PyObject *)exception_tb);
|
|
939
|
+
if (exception_tb != NULL) {
|
|
940
|
+
PRINT_REFCOUNT((PyObject *)exception_tb);
|
|
941
|
+
}
|
|
946
942
|
|
|
947
943
|
PRINT_NEW_LINE();
|
|
948
944
|
}
|
|
949
945
|
|
|
946
|
+
#if PYTHON_VERSION >= 0x3b0
|
|
947
|
+
void _PRINT_EXCEPTION1(PyObject *exception_value) {
|
|
948
|
+
PyObject *exception_type = exception_value ? PyExceptionInstance_Class(exception_value) : NULL;
|
|
949
|
+
PyTracebackObject *exception_tb = (exception_value && PyExceptionInstance_Check(exception_value))
|
|
950
|
+
? GET_EXCEPTION_TRACEBACK(exception_value)
|
|
951
|
+
: NULL;
|
|
952
|
+
|
|
953
|
+
_PRINT_EXCEPTION3(exception_type, exception_value, exception_tb);
|
|
954
|
+
}
|
|
955
|
+
#endif
|
|
956
|
+
|
|
950
957
|
void PRINT_CURRENT_EXCEPTION(void) {
|
|
951
958
|
PyThreadState *tstate = PyThreadState_GET();
|
|
952
959
|
|
|
@@ -954,7 +961,7 @@ void PRINT_CURRENT_EXCEPTION(void) {
|
|
|
954
961
|
#if PYTHON_VERSION < 0x3c0
|
|
955
962
|
PRINT_EXCEPTION(tstate->curexc_type, tstate->curexc_value, (PyTracebackObject *)tstate->curexc_traceback);
|
|
956
963
|
#else
|
|
957
|
-
|
|
964
|
+
_PRINT_EXCEPTION1(tstate->exc_info->exc_value);
|
|
958
965
|
#endif
|
|
959
966
|
}
|
|
960
967
|
|
|
@@ -962,7 +969,11 @@ void PRINT_PUBLISHED_EXCEPTION(void) {
|
|
|
962
969
|
PyThreadState *tstate = PyThreadState_GET();
|
|
963
970
|
|
|
964
971
|
PRINT_STRING("thread_exc=");
|
|
972
|
+
#if PYTHON_VERSION < 0x3b0
|
|
965
973
|
PRINT_EXCEPTION(EXC_TYPE(tstate), EXC_VALUE(tstate), EXC_TRACEBACK(tstate));
|
|
974
|
+
#else
|
|
975
|
+
PRINT_EXCEPTION(EXC_TYPE(tstate), EXC_VALUE(tstate), GET_EXCEPTION_TRACEBACK(EXC_VALUE(tstate)));
|
|
976
|
+
#endif
|
|
966
977
|
}
|
|
967
978
|
|
|
968
979
|
// TODO: Could be ported, the "printf" stuff would need to be split. On Python3
|
|
@@ -1277,7 +1288,7 @@ static PyObject *QUICK_ITERATOR_NEXT(PyThreadState *tstate, struct Nuitka_QuickI
|
|
|
1277
1288
|
|
|
1278
1289
|
switch (qiter->iterator_mode) {
|
|
1279
1290
|
case ITERATOR_GENERIC:
|
|
1280
|
-
result =
|
|
1291
|
+
result = ITERATOR_NEXT_ITERATOR(qiter->iterator_data.iter);
|
|
1281
1292
|
|
|
1282
1293
|
if (result == NULL) {
|
|
1283
1294
|
Py_DECREF(qiter->iterator_data.iter);
|
|
@@ -1349,11 +1360,7 @@ PyObject *BUILTIN_SUM1(PyThreadState *tstate, PyObject *sequence) {
|
|
|
1349
1360
|
item = QUICK_ITERATOR_NEXT(tstate, &qiter, &finished);
|
|
1350
1361
|
|
|
1351
1362
|
if (finished) {
|
|
1352
|
-
|
|
1353
|
-
return PyInt_FromLong(int_result);
|
|
1354
|
-
#else
|
|
1355
|
-
return PyLong_FromLong(int_result);
|
|
1356
|
-
#endif
|
|
1363
|
+
return Nuitka_PyInt_FromLong(int_result);
|
|
1357
1364
|
} else if (item == NULL) {
|
|
1358
1365
|
return NULL;
|
|
1359
1366
|
}
|
|
@@ -1417,12 +1424,8 @@ PyObject *BUILTIN_SUM1(PyThreadState *tstate, PyObject *sequence) {
|
|
|
1417
1424
|
break;
|
|
1418
1425
|
}
|
|
1419
1426
|
|
|
1420
|
-
/* Switch over to objects, and redo last step. */
|
|
1421
|
-
|
|
1422
|
-
result = PyInt_FromLong(int_result);
|
|
1423
|
-
#else
|
|
1424
|
-
result = PyLong_FromLong(int_result);
|
|
1425
|
-
#endif
|
|
1427
|
+
/* Switch over to objects, and redo last step. */
|
|
1428
|
+
result = Nuitka_PyInt_FromLong(int_result);
|
|
1426
1429
|
CHECK_OBJECT(result);
|
|
1427
1430
|
|
|
1428
1431
|
PyObject *temp = PyNumber_Add(result, item);
|
|
@@ -1476,7 +1479,7 @@ PyObject *BUILTIN_SUM2(PyThreadState *tstate, PyObject *sequence, PyObject *star
|
|
|
1476
1479
|
|
|
1477
1480
|
PyObject *pos_args = MAKE_TUPLE2(tstate, sequence, start);
|
|
1478
1481
|
|
|
1479
|
-
PyObject *result =
|
|
1482
|
+
PyObject *result = CALL_FUNCTION_WITH_POS_ARGS2(tstate, NUITKA_ACCESS_BUILTIN(sum), pos_args);
|
|
1480
1483
|
|
|
1481
1484
|
Py_DECREF(pos_args);
|
|
1482
1485
|
|
|
@@ -1717,8 +1720,8 @@ char const *getBinaryDirectoryHostEncoded(bool resolve_symlinks) {
|
|
|
1717
1720
|
|
|
1718
1721
|
#endif
|
|
1719
1722
|
|
|
1720
|
-
#ifdef
|
|
1721
|
-
|
|
1723
|
+
#ifdef _NUITKA_EXE
|
|
1724
|
+
PyObject *getBinaryFilenameObject(bool resolve_symlinks) {
|
|
1722
1725
|
static PyObject *binary_filename = NULL;
|
|
1723
1726
|
static PyObject *binary_filename_resolved = NULL;
|
|
1724
1727
|
|
|
@@ -1816,7 +1819,7 @@ PyObject *getStandaloneSysExecutablePath(PyObject *basename) {
|
|
|
1816
1819
|
#else
|
|
1817
1820
|
|
|
1818
1821
|
#if defined(_WIN32)
|
|
1819
|
-
|
|
1822
|
+
// Small helper function to get current DLL handle, spell-checker: ignore lpcstr
|
|
1820
1823
|
static HMODULE getDllModuleHandle(void) {
|
|
1821
1824
|
static HMODULE hm = NULL;
|
|
1822
1825
|
|
|
@@ -1832,7 +1835,7 @@ static HMODULE getDllModuleHandle(void) {
|
|
|
1832
1835
|
}
|
|
1833
1836
|
#endif
|
|
1834
1837
|
|
|
1835
|
-
|
|
1838
|
+
filename_char_t const *getDllDirectory(void) {
|
|
1836
1839
|
#if defined(_WIN32)
|
|
1837
1840
|
static WCHAR path[MAXPATHLEN + 1];
|
|
1838
1841
|
path[0] = 0;
|
|
@@ -1882,6 +1885,56 @@ static PyObject *getDllDirectoryObject(void) {
|
|
|
1882
1885
|
}
|
|
1883
1886
|
#endif
|
|
1884
1887
|
|
|
1888
|
+
#if defined(_NUITKA_MODULE)
|
|
1889
|
+
static filename_char_t const *getDllFilename(void) {
|
|
1890
|
+
#if defined(_WIN32)
|
|
1891
|
+
static WCHAR path[MAXPATHLEN + 1];
|
|
1892
|
+
path[0] = 0;
|
|
1893
|
+
|
|
1894
|
+
int res = GetModuleFileNameW(getDllModuleHandle(), path, MAXPATHLEN);
|
|
1895
|
+
assert(res != 0);
|
|
1896
|
+
|
|
1897
|
+
return path;
|
|
1898
|
+
#else
|
|
1899
|
+
Dl_info where;
|
|
1900
|
+
|
|
1901
|
+
{
|
|
1902
|
+
NUITKA_MAY_BE_UNUSED int res = dladdr((void *)getDllDirectory, &where);
|
|
1903
|
+
assert(res != 0);
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
return where.dli_fname;
|
|
1907
|
+
#endif
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
PyObject *getDllFilenameObject(void) {
|
|
1911
|
+
static PyObject *dll_filename = NULL;
|
|
1912
|
+
|
|
1913
|
+
if (dll_filename == NULL) {
|
|
1914
|
+
filename_char_t const *dll_filename_str = getDllFilename();
|
|
1915
|
+
|
|
1916
|
+
dll_filename = Nuitka_String_FromFilename(dll_filename_str);
|
|
1917
|
+
|
|
1918
|
+
#if PYTHON_VERSION < 0x300
|
|
1919
|
+
// Avoid unnecessary unicode values.
|
|
1920
|
+
PyObject *decoded_dll_filename = PyObject_Str(dll_filename);
|
|
1921
|
+
|
|
1922
|
+
if (decoded_dll_filename == NULL) {
|
|
1923
|
+
PyThreadState *tstate = PyThreadState_GET();
|
|
1924
|
+
DROP_ERROR_OCCURRED(tstate);
|
|
1925
|
+
} else {
|
|
1926
|
+
Py_DECREF(dll_filename);
|
|
1927
|
+
dll_filename = decoded_dll_filename;
|
|
1928
|
+
}
|
|
1929
|
+
#endif
|
|
1930
|
+
}
|
|
1931
|
+
|
|
1932
|
+
CHECK_OBJECT(dll_filename);
|
|
1933
|
+
|
|
1934
|
+
return dll_filename;
|
|
1935
|
+
}
|
|
1936
|
+
#endif
|
|
1937
|
+
|
|
1885
1938
|
PyObject *getContainingDirectoryObject(bool resolve_symlinks) {
|
|
1886
1939
|
#if defined(_NUITKA_EXE)
|
|
1887
1940
|
#if defined(_NUITKA_ONEFILE_MODE)
|
|
@@ -2089,6 +2142,8 @@ PyObject *MAKE_UNION_TYPE(PyObject *args) {
|
|
|
2089
2142
|
#include "HelpersOperationBinaryMatmult.c"
|
|
2090
2143
|
#endif
|
|
2091
2144
|
|
|
2145
|
+
#include "HelpersOperationBinaryDualAdd.c"
|
|
2146
|
+
|
|
2092
2147
|
#include "HelpersOperationInplaceAdd.c"
|
|
2093
2148
|
#include "HelpersOperationInplaceBitand.c"
|
|
2094
2149
|
#include "HelpersOperationInplaceBitor.c"
|
|
@@ -2109,12 +2164,21 @@ PyObject *MAKE_UNION_TYPE(PyObject *args) {
|
|
|
2109
2164
|
#endif
|
|
2110
2165
|
|
|
2111
2166
|
#include "HelpersComparisonEq.c"
|
|
2112
|
-
#include "HelpersComparisonGe.c"
|
|
2113
|
-
#include "HelpersComparisonGt.c"
|
|
2114
2167
|
#include "HelpersComparisonLe.c"
|
|
2115
2168
|
#include "HelpersComparisonLt.c"
|
|
2169
|
+
|
|
2170
|
+
#include "HelpersComparisonGe.c"
|
|
2171
|
+
#include "HelpersComparisonGt.c"
|
|
2116
2172
|
#include "HelpersComparisonNe.c"
|
|
2117
2173
|
|
|
2174
|
+
#include "HelpersComparisonDualEq.c"
|
|
2175
|
+
#include "HelpersComparisonDualLe.c"
|
|
2176
|
+
#include "HelpersComparisonDualLt.c"
|
|
2177
|
+
|
|
2178
|
+
#include "HelpersComparisonDualGe.c"
|
|
2179
|
+
#include "HelpersComparisonDualGt.c"
|
|
2180
|
+
#include "HelpersComparisonDualNe.c"
|
|
2181
|
+
|
|
2118
2182
|
#include "HelpersChecksumTools.c"
|
|
2119
2183
|
#include "HelpersConstantsBlob.c"
|
|
2120
2184
|
|
|
@@ -62,15 +62,16 @@ static PyObject *_Nuitka_Coroutine_send(PyThreadState *tstate, struct Nuitka_Cor
|
|
|
62
62
|
|
|
63
63
|
static long Nuitka_Coroutine_tp_hash(struct Nuitka_CoroutineObject *coroutine) { return coroutine->m_counter; }
|
|
64
64
|
|
|
65
|
-
static PyObject *Nuitka_Coroutine_get_name(
|
|
66
|
-
CHECK_OBJECT(
|
|
65
|
+
static PyObject *Nuitka_Coroutine_get_name(PyObject *self, void *data) {
|
|
66
|
+
CHECK_OBJECT(self);
|
|
67
67
|
|
|
68
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
68
69
|
Py_INCREF(coroutine->m_name);
|
|
69
70
|
return coroutine->m_name;
|
|
70
71
|
}
|
|
71
72
|
|
|
72
|
-
static int Nuitka_Coroutine_set_name(
|
|
73
|
-
CHECK_OBJECT(
|
|
73
|
+
static int Nuitka_Coroutine_set_name(PyObject *self, PyObject *value, void *data) {
|
|
74
|
+
CHECK_OBJECT(self);
|
|
74
75
|
CHECK_OBJECT_X(value);
|
|
75
76
|
|
|
76
77
|
// Cannot be deleted, not be non-unicode value.
|
|
@@ -81,6 +82,7 @@ static int Nuitka_Coroutine_set_name(struct Nuitka_CoroutineObject *coroutine, P
|
|
|
81
82
|
return -1;
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
84
86
|
PyObject *tmp = coroutine->m_name;
|
|
85
87
|
Py_INCREF(value);
|
|
86
88
|
coroutine->m_name = value;
|
|
@@ -89,15 +91,16 @@ static int Nuitka_Coroutine_set_name(struct Nuitka_CoroutineObject *coroutine, P
|
|
|
89
91
|
return 0;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
static PyObject *Nuitka_Coroutine_get_qualname(
|
|
93
|
-
CHECK_OBJECT(
|
|
94
|
+
static PyObject *Nuitka_Coroutine_get_qualname(PyObject *self, void *data) {
|
|
95
|
+
CHECK_OBJECT(self);
|
|
94
96
|
|
|
97
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
95
98
|
Py_INCREF(coroutine->m_qualname);
|
|
96
99
|
return coroutine->m_qualname;
|
|
97
100
|
}
|
|
98
101
|
|
|
99
|
-
static int Nuitka_Coroutine_set_qualname(
|
|
100
|
-
CHECK_OBJECT(
|
|
102
|
+
static int Nuitka_Coroutine_set_qualname(PyObject *self, PyObject *value, void *data) {
|
|
103
|
+
CHECK_OBJECT(self);
|
|
101
104
|
CHECK_OBJECT_X(value);
|
|
102
105
|
|
|
103
106
|
// Cannot be deleted, not be non-unicode value.
|
|
@@ -108,6 +111,7 @@ static int Nuitka_Coroutine_set_qualname(struct Nuitka_CoroutineObject *coroutin
|
|
|
108
111
|
return -1;
|
|
109
112
|
}
|
|
110
113
|
|
|
114
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
111
115
|
PyObject *tmp = coroutine->m_qualname;
|
|
112
116
|
Py_INCREF(value);
|
|
113
117
|
coroutine->m_qualname = value;
|
|
@@ -116,7 +120,8 @@ static int Nuitka_Coroutine_set_qualname(struct Nuitka_CoroutineObject *coroutin
|
|
|
116
120
|
return 0;
|
|
117
121
|
}
|
|
118
122
|
|
|
119
|
-
static PyObject *Nuitka_Coroutine_get_cr_await(
|
|
123
|
+
static PyObject *Nuitka_Coroutine_get_cr_await(PyObject *self, void *data) {
|
|
124
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
120
125
|
CHECK_OBJECT(coroutine);
|
|
121
126
|
CHECK_OBJECT_X(coroutine->m_yield_from);
|
|
122
127
|
|
|
@@ -129,7 +134,8 @@ static PyObject *Nuitka_Coroutine_get_cr_await(struct Nuitka_CoroutineObject *co
|
|
|
129
134
|
}
|
|
130
135
|
}
|
|
131
136
|
|
|
132
|
-
static PyObject *Nuitka_Coroutine_get_code(
|
|
137
|
+
static PyObject *Nuitka_Coroutine_get_code(PyObject *self, void *data) {
|
|
138
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
133
139
|
CHECK_OBJECT(coroutine);
|
|
134
140
|
CHECK_OBJECT(coroutine->m_code_object);
|
|
135
141
|
|
|
@@ -137,8 +143,8 @@ static PyObject *Nuitka_Coroutine_get_code(struct Nuitka_CoroutineObject *corout
|
|
|
137
143
|
return (PyObject *)coroutine->m_code_object;
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
static int Nuitka_Coroutine_set_code(
|
|
141
|
-
CHECK_OBJECT(
|
|
146
|
+
static int Nuitka_Coroutine_set_code(PyObject *self, PyObject *value, void *data) {
|
|
147
|
+
CHECK_OBJECT(self);
|
|
142
148
|
|
|
143
149
|
PyThreadState *tstate = PyThreadState_GET();
|
|
144
150
|
|
|
@@ -146,7 +152,8 @@ static int Nuitka_Coroutine_set_code(struct Nuitka_CoroutineObject *coroutine, P
|
|
|
146
152
|
return -1;
|
|
147
153
|
}
|
|
148
154
|
|
|
149
|
-
static PyObject *Nuitka_Coroutine_get_frame(
|
|
155
|
+
static PyObject *Nuitka_Coroutine_get_frame(PyObject *self, void *data) {
|
|
156
|
+
struct Nuitka_CoroutineObject *coroutine = (struct Nuitka_CoroutineObject *)self;
|
|
150
157
|
CHECK_OBJECT(coroutine);
|
|
151
158
|
CHECK_OBJECT_X(coroutine->m_frame);
|
|
152
159
|
|
|
@@ -159,8 +166,8 @@ static PyObject *Nuitka_Coroutine_get_frame(struct Nuitka_CoroutineObject *corou
|
|
|
159
166
|
}
|
|
160
167
|
}
|
|
161
168
|
|
|
162
|
-
static int Nuitka_Coroutine_set_frame(
|
|
163
|
-
CHECK_OBJECT(
|
|
169
|
+
static int Nuitka_Coroutine_set_frame(PyObject *self, PyObject *value, void *data) {
|
|
170
|
+
CHECK_OBJECT(self);
|
|
164
171
|
CHECK_OBJECT_X(value);
|
|
165
172
|
|
|
166
173
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -625,7 +632,7 @@ static PyObject *Nuitka_Coroutine_send(struct Nuitka_CoroutineObject *coroutine,
|
|
|
625
632
|
|
|
626
633
|
if (result == NULL) {
|
|
627
634
|
if (HAS_ERROR_OCCURRED(tstate) == false) {
|
|
628
|
-
|
|
635
|
+
SET_CURRENT_EXCEPTION_STOP_ITERATION_EMPTY(tstate);
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
638
|
|
|
@@ -812,7 +819,7 @@ static PyObject *_Nuitka_Coroutine_throw2(PyThreadState *tstate, struct Nuitka_C
|
|
|
812
819
|
}
|
|
813
820
|
|
|
814
821
|
PyObject *val;
|
|
815
|
-
if (
|
|
822
|
+
if (Nuitka_PyGen_FetchStopIterationValue(tstate, &val)) {
|
|
816
823
|
CHECK_OBJECT(val);
|
|
817
824
|
|
|
818
825
|
#if _DEBUG_COROUTINE
|
|
@@ -962,7 +969,7 @@ static PyObject *Nuitka_Coroutine_throw(struct Nuitka_CoroutineObject *coroutine
|
|
|
962
969
|
|
|
963
970
|
if (result == NULL) {
|
|
964
971
|
if (HAS_ERROR_OCCURRED(tstate) == false) {
|
|
965
|
-
|
|
972
|
+
SET_CURRENT_EXCEPTION_STOP_ITERATION_EMPTY(tstate);
|
|
966
973
|
}
|
|
967
974
|
}
|
|
968
975
|
|
|
@@ -1154,11 +1161,11 @@ static PyMethodDef Nuitka_Coroutine_methods[] = {{"send", (PyCFunction)Nuitka_Co
|
|
|
1154
1161
|
// TODO: Set "__doc__" automatically for method clones of compiled types from
|
|
1155
1162
|
// the documentation of built-in original type.
|
|
1156
1163
|
static PyGetSetDef Nuitka_Coroutine_tp_getset[] = {
|
|
1157
|
-
{(char *)"__name__",
|
|
1158
|
-
{(char *)"__qualname__",
|
|
1159
|
-
{(char *)"cr_await",
|
|
1160
|
-
{(char *)"cr_code",
|
|
1161
|
-
{(char *)"cr_frame",
|
|
1164
|
+
{(char *)"__name__", Nuitka_Coroutine_get_name, Nuitka_Coroutine_set_name, NULL},
|
|
1165
|
+
{(char *)"__qualname__", Nuitka_Coroutine_get_qualname, Nuitka_Coroutine_set_qualname, NULL},
|
|
1166
|
+
{(char *)"cr_await", Nuitka_Coroutine_get_cr_await, NULL, NULL},
|
|
1167
|
+
{(char *)"cr_code", Nuitka_Coroutine_get_code, Nuitka_Coroutine_set_code, NULL},
|
|
1168
|
+
{(char *)"cr_frame", Nuitka_Coroutine_get_frame, Nuitka_Coroutine_set_frame, NULL},
|
|
1162
1169
|
|
|
1163
1170
|
{NULL}};
|
|
1164
1171
|
|
|
@@ -1651,21 +1658,24 @@ static PyObject *Nuitka_AIterWrapper_iternext(struct Nuitka_AIterWrapper *aw) {
|
|
|
1651
1658
|
|
|
1652
1659
|
#if PYTHON_VERSION < 0x360
|
|
1653
1660
|
SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_StopIteration, aw->aw_aiter);
|
|
1654
|
-
#
|
|
1661
|
+
#elif PYTHON_VERSION < 0x3c0
|
|
1655
1662
|
if (!PyTuple_Check(aw->aw_aiter) && !PyExceptionInstance_Check(aw->aw_aiter)) {
|
|
1656
|
-
|
|
1657
|
-
Py_INCREF(aw->aw_aiter);
|
|
1658
|
-
|
|
1659
|
-
RESTORE_ERROR_OCCURRED(tstate, PyExc_StopIteration, aw->aw_aiter, NULL);
|
|
1663
|
+
SET_CURRENT_EXCEPTION_TYPE0_VALUE0(tstate, PyExc_StopIteration, aw->aw_aiter);
|
|
1660
1664
|
} else {
|
|
1661
1665
|
PyObject *result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, PyExc_StopIteration, aw->aw_aiter);
|
|
1666
|
+
|
|
1662
1667
|
if (unlikely(result == NULL)) {
|
|
1663
1668
|
return NULL;
|
|
1664
1669
|
}
|
|
1665
1670
|
|
|
1666
|
-
|
|
1667
|
-
|
|
1671
|
+
struct Nuitka_ExceptionPreservationItem exception_state = {_Py_NewRef(PyExc_StopIteration), result, NULL};
|
|
1672
|
+
|
|
1673
|
+
RESTORE_ERROR_OCCURRED_STATE(tstate, &exception_state);
|
|
1668
1674
|
}
|
|
1675
|
+
#else
|
|
1676
|
+
struct Nuitka_ExceptionPreservationItem exception_state = {Nuitka_CreateStopIteration(tstate, aw->aw_aiter)};
|
|
1677
|
+
|
|
1678
|
+
RESTORE_ERROR_OCCURRED_STATE(tstate, &exception_state);
|
|
1669
1679
|
#endif
|
|
1670
1680
|
|
|
1671
1681
|
return NULL;
|