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
|
@@ -166,7 +166,7 @@ static PyObject *ERROR_GET_STOP_ITERATION_VALUE(PyThreadState *tstate) {
|
|
|
166
166
|
|
|
167
167
|
PyObject *value = NULL;
|
|
168
168
|
|
|
169
|
-
if (exception_value) {
|
|
169
|
+
if (exception_value != NULL) {
|
|
170
170
|
if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, exception_value, PyExc_StopIteration)) {
|
|
171
171
|
value = ((PyStopIterationObject *)exception_value)->value;
|
|
172
172
|
Py_XINCREF(value);
|
|
@@ -281,7 +281,7 @@ static PyObject *_Nuitka_YieldFromPassExceptionTo(PyThreadState *tstate, PyObjec
|
|
|
281
281
|
|
|
282
282
|
PyObject *throw_method = PyObject_GetAttr(value, const_str_plain_throw);
|
|
283
283
|
|
|
284
|
-
if (throw_method) {
|
|
284
|
+
if (throw_method != NULL) {
|
|
285
285
|
PyObject *result = Nuitka_CallGeneratorThrowMethod(throw_method, exception_state);
|
|
286
286
|
Py_DECREF(throw_method);
|
|
287
287
|
|
|
@@ -289,16 +289,16 @@ static PyObject *_Nuitka_YieldFromPassExceptionTo(PyThreadState *tstate, PyObjec
|
|
|
289
289
|
RELEASE_ERROR_OCCURRED_STATE(exception_state);
|
|
290
290
|
|
|
291
291
|
return result;
|
|
292
|
-
} else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {
|
|
293
|
-
// Restoring the exception we own, to be released when handling it.
|
|
294
|
-
RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);
|
|
295
|
-
|
|
296
|
-
return NULL;
|
|
297
292
|
} else {
|
|
298
293
|
assert(HAS_ERROR_OCCURRED(tstate));
|
|
299
294
|
|
|
300
|
-
|
|
301
|
-
|
|
295
|
+
if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, GET_ERROR_OCCURRED(tstate), PyExc_AttributeError)) {
|
|
296
|
+
// Restoring the exception we own, to be released when handling it.
|
|
297
|
+
RESTORE_ERROR_OCCURRED_STATE(tstate, exception_state);
|
|
298
|
+
} else {
|
|
299
|
+
// Releasing exception we own.
|
|
300
|
+
RELEASE_ERROR_OCCURRED_STATE(exception_state);
|
|
301
|
+
}
|
|
302
302
|
|
|
303
303
|
return NULL;
|
|
304
304
|
}
|
|
@@ -471,23 +471,20 @@ static void RAISE_RUNTIME_ERROR_RAISED_STOP_ITERATION(PyThreadState *tstate, cha
|
|
|
471
471
|
FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);
|
|
472
472
|
|
|
473
473
|
#if PYTHON_VERSION < 0x3c0
|
|
474
|
-
|
|
475
|
-
&saved_exception_state.exception_tb);
|
|
474
|
+
NORMALIZE_EXCEPTION_STATE(tstate, &saved_exception_state);
|
|
476
475
|
#endif
|
|
477
476
|
|
|
478
477
|
struct Nuitka_ExceptionPreservationItem new_exception_state;
|
|
479
478
|
SET_EXCEPTION_PRESERVATION_STATE_FROM_TYPE0_STR(tstate, &new_exception_state, PyExc_RuntimeError, message);
|
|
480
479
|
|
|
481
480
|
#if PYTHON_VERSION < 0x3c0
|
|
482
|
-
|
|
483
|
-
&new_exception_state.exception_tb);
|
|
481
|
+
NORMALIZE_EXCEPTION_STATE(tstate, &new_exception_state);
|
|
484
482
|
#endif
|
|
485
483
|
|
|
486
484
|
Py_INCREF(saved_exception_state.exception_value);
|
|
487
|
-
|
|
485
|
+
RAISE_EXCEPTION_WITH_CAUSE(tstate, &new_exception_state, saved_exception_state.exception_value);
|
|
488
486
|
|
|
489
|
-
|
|
490
|
-
PyException_SetContext(new_exception_state.exception_value, saved_exception_state.exception_value);
|
|
487
|
+
Nuitka_Exception_SetContext(new_exception_state.exception_value, saved_exception_state.exception_value);
|
|
491
488
|
|
|
492
489
|
RELEASE_ERROR_OCCURRED_STATE_X(&saved_exception_state);
|
|
493
490
|
RESTORE_ERROR_OCCURRED_STATE(tstate, &new_exception_state);
|
|
@@ -500,7 +497,6 @@ static PyObject *_Nuitka_Generator_send(PyThreadState *tstate, struct Nuitka_Gen
|
|
|
500
497
|
assert(Nuitka_Generator_Check((PyObject *)generator));
|
|
501
498
|
CHECK_EXCEPTION_STATE_X(exception_state);
|
|
502
499
|
CHECK_OBJECT_X(value);
|
|
503
|
-
assert(PyThreadState_GET() == tstate);
|
|
504
500
|
|
|
505
501
|
#if _DEBUG_GENERATOR
|
|
506
502
|
PRINT_GENERATOR_STATUS("Enter", generator);
|
|
@@ -581,7 +577,6 @@ static PyObject *_Nuitka_Generator_send(PyThreadState *tstate, struct Nuitka_Gen
|
|
|
581
577
|
#else
|
|
582
578
|
yielded = ((generator_code)generator->m_code)(tstate, generator, value);
|
|
583
579
|
#endif
|
|
584
|
-
assert(PyThreadState_GET() == tstate);
|
|
585
580
|
|
|
586
581
|
#if PYTHON_VERSION >= 0x300
|
|
587
582
|
// If the generator returns with m_yield_from set, it wants us to yield
|
|
@@ -590,8 +585,6 @@ static PyObject *_Nuitka_Generator_send(PyThreadState *tstate, struct Nuitka_Gen
|
|
|
590
585
|
yielded = Nuitka_YieldFromGeneratorNext(tstate, generator);
|
|
591
586
|
}
|
|
592
587
|
#endif
|
|
593
|
-
assert(PyThreadState_GET() == tstate);
|
|
594
|
-
|
|
595
588
|
Nuitka_MarkGeneratorAsNotRunning(generator);
|
|
596
589
|
|
|
597
590
|
// Remove the generator from the frame stack.
|
|
@@ -679,7 +672,7 @@ static PyObject *_Nuitka_Generator_send(PyThreadState *tstate, struct Nuitka_Gen
|
|
|
679
672
|
PyObject *old_value = tstate->exc_value;
|
|
680
673
|
PyTracebackObject *old_tb = (PyTracebackObject *)tstate->exc_traceback;
|
|
681
674
|
|
|
682
|
-
// Set sys attributes in the fastest possible way
|
|
675
|
+
// Set sys attributes in the fastest possible way, spell-checker: ignore sysdict
|
|
683
676
|
PyObject *sys_dict = tstate->interp->sysdict;
|
|
684
677
|
CHECK_OBJECT(sys_dict);
|
|
685
678
|
|
|
@@ -761,7 +754,7 @@ static PyObject *Nuitka_Generator_send(struct Nuitka_GeneratorObject *generator,
|
|
|
761
754
|
|
|
762
755
|
if (result == NULL) {
|
|
763
756
|
if (HAS_ERROR_OCCURRED(tstate) == false) {
|
|
764
|
-
|
|
757
|
+
SET_CURRENT_EXCEPTION_STOP_ITERATION_EMPTY(tstate);
|
|
765
758
|
}
|
|
766
759
|
}
|
|
767
760
|
|
|
@@ -849,7 +842,7 @@ static bool _Nuitka_Generator_close(PyThreadState *tstate, struct Nuitka_Generat
|
|
|
849
842
|
return true;
|
|
850
843
|
}
|
|
851
844
|
|
|
852
|
-
static PyObject *Nuitka_Generator_close(struct Nuitka_GeneratorObject *generator) {
|
|
845
|
+
static PyObject *Nuitka_Generator_close(struct Nuitka_GeneratorObject *generator, PyObject *unused) {
|
|
853
846
|
PyThreadState *tstate = PyThreadState_GET();
|
|
854
847
|
|
|
855
848
|
bool r = _Nuitka_Generator_close(tstate, generator);
|
|
@@ -954,8 +947,7 @@ static bool _Nuitka_Generator_check_throw(PyThreadState *tstate,
|
|
|
954
947
|
|
|
955
948
|
if (PyExceptionClass_Check(exception_state->exception_type)) {
|
|
956
949
|
// TODO: Must not / need not normalize here?
|
|
957
|
-
|
|
958
|
-
&exception_state->exception_tb);
|
|
950
|
+
NORMALIZE_EXCEPTION_STATE(tstate, exception_state);
|
|
959
951
|
} else if (PyExceptionInstance_Check(exception_state->exception_type)) {
|
|
960
952
|
if (exception_state->exception_value != NULL && exception_state->exception_value != Py_None) {
|
|
961
953
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError,
|
|
@@ -1222,7 +1214,7 @@ static PyObject *_Nuitka_Generator_throw2(PyThreadState *tstate, struct Nuitka_G
|
|
|
1222
1214
|
}
|
|
1223
1215
|
|
|
1224
1216
|
PyObject *val;
|
|
1225
|
-
if (
|
|
1217
|
+
if (Nuitka_PyGen_FetchStopIterationValue(tstate, &val)) {
|
|
1226
1218
|
CHECK_OBJECT(val);
|
|
1227
1219
|
|
|
1228
1220
|
#if _DEBUG_GENERATOR
|
|
@@ -1281,8 +1273,8 @@ throw_here:
|
|
|
1281
1273
|
PyObject *result = _Nuitka_Generator_send(tstate, generator, NULL, exception_state);
|
|
1282
1274
|
|
|
1283
1275
|
if (result == NULL) {
|
|
1284
|
-
if (
|
|
1285
|
-
|
|
1276
|
+
if (HAS_ERROR_OCCURRED(tstate) == false) {
|
|
1277
|
+
SET_CURRENT_EXCEPTION_STOP_ITERATION_EMPTY(tstate);
|
|
1286
1278
|
}
|
|
1287
1279
|
}
|
|
1288
1280
|
|
|
@@ -1338,7 +1330,7 @@ static PyObject *Nuitka_Generator_throw(struct Nuitka_GeneratorObject *generator
|
|
|
1338
1330
|
|
|
1339
1331
|
if (result == NULL) {
|
|
1340
1332
|
if (HAS_ERROR_OCCURRED(tstate) == false) {
|
|
1341
|
-
|
|
1333
|
+
SET_CURRENT_EXCEPTION_STOP_ITERATION_EMPTY(tstate);
|
|
1342
1334
|
}
|
|
1343
1335
|
}
|
|
1344
1336
|
|
|
@@ -1441,14 +1433,15 @@ static void Nuitka_Generator_tp_dealloc(struct Nuitka_GeneratorObject *generator
|
|
|
1441
1433
|
|
|
1442
1434
|
static long Nuitka_Generator_tp_hash(struct Nuitka_GeneratorObject *generator) { return generator->m_counter; }
|
|
1443
1435
|
|
|
1444
|
-
static PyObject *Nuitka_Generator_get_name(
|
|
1436
|
+
static PyObject *Nuitka_Generator_get_name(PyObject *self, void *data) {
|
|
1437
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1445
1438
|
PyObject *result = generator->m_name;
|
|
1446
1439
|
Py_INCREF(result);
|
|
1447
1440
|
return result;
|
|
1448
1441
|
}
|
|
1449
1442
|
|
|
1450
1443
|
#if PYTHON_VERSION >= 0x350
|
|
1451
|
-
static int Nuitka_Generator_set_name(
|
|
1444
|
+
static int Nuitka_Generator_set_name(PyObject *self, PyObject *value, void *data) {
|
|
1452
1445
|
// Cannot be deleted, not be non-unicode value.
|
|
1453
1446
|
if (unlikely((value == NULL) || !PyUnicode_Check(value))) {
|
|
1454
1447
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -1457,6 +1450,7 @@ static int Nuitka_Generator_set_name(struct Nuitka_GeneratorObject *generator, P
|
|
|
1457
1450
|
return -1;
|
|
1458
1451
|
}
|
|
1459
1452
|
|
|
1453
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1460
1454
|
PyObject *tmp = generator->m_name;
|
|
1461
1455
|
Py_INCREF(value);
|
|
1462
1456
|
generator->m_name = value;
|
|
@@ -1465,13 +1459,14 @@ static int Nuitka_Generator_set_name(struct Nuitka_GeneratorObject *generator, P
|
|
|
1465
1459
|
return 0;
|
|
1466
1460
|
}
|
|
1467
1461
|
|
|
1468
|
-
static PyObject *Nuitka_Generator_get_qualname(
|
|
1462
|
+
static PyObject *Nuitka_Generator_get_qualname(PyObject *self, void *data) {
|
|
1463
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1469
1464
|
PyObject *result = generator->m_qualname;
|
|
1470
1465
|
Py_INCREF(result);
|
|
1471
1466
|
return result;
|
|
1472
1467
|
}
|
|
1473
1468
|
|
|
1474
|
-
static int Nuitka_Generator_set_qualname(
|
|
1469
|
+
static int Nuitka_Generator_set_qualname(PyObject *self, PyObject *value, void *data) {
|
|
1475
1470
|
// Cannot be deleted, not be non-unicode value.
|
|
1476
1471
|
if (unlikely((value == NULL) || !PyUnicode_Check(value))) {
|
|
1477
1472
|
PyThreadState *tstate = PyThreadState_GET();
|
|
@@ -1480,6 +1475,7 @@ static int Nuitka_Generator_set_qualname(struct Nuitka_GeneratorObject *generato
|
|
|
1480
1475
|
return -1;
|
|
1481
1476
|
}
|
|
1482
1477
|
|
|
1478
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1483
1479
|
PyObject *tmp = generator->m_qualname;
|
|
1484
1480
|
Py_INCREF(value);
|
|
1485
1481
|
generator->m_qualname = value;
|
|
@@ -1488,7 +1484,8 @@ static int Nuitka_Generator_set_qualname(struct Nuitka_GeneratorObject *generato
|
|
|
1488
1484
|
return 0;
|
|
1489
1485
|
}
|
|
1490
1486
|
|
|
1491
|
-
static PyObject *
|
|
1487
|
+
static PyObject *Nuitka_Generator_get_yield_from(PyObject *self, void *data) {
|
|
1488
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1492
1489
|
if (generator->m_yield_from) {
|
|
1493
1490
|
Py_INCREF(generator->m_yield_from);
|
|
1494
1491
|
return generator->m_yield_from;
|
|
@@ -1500,22 +1497,24 @@ static PyObject *Nuitka_Generator_get_yieldfrom(struct Nuitka_GeneratorObject *g
|
|
|
1500
1497
|
|
|
1501
1498
|
#endif
|
|
1502
1499
|
|
|
1503
|
-
static PyObject *Nuitka_Generator_get_code(
|
|
1500
|
+
static PyObject *Nuitka_Generator_get_code(PyObject *self, void *data) {
|
|
1501
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1504
1502
|
PyObject *result = (PyObject *)generator->m_code_object;
|
|
1505
1503
|
Py_INCREF(result);
|
|
1506
1504
|
return result;
|
|
1507
1505
|
}
|
|
1508
1506
|
|
|
1509
|
-
static int Nuitka_Generator_set_code(
|
|
1507
|
+
static int Nuitka_Generator_set_code(PyObject *self, PyObject *value, void *data) {
|
|
1510
1508
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1511
1509
|
|
|
1512
1510
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, "gi_code is not writable in Nuitka");
|
|
1513
1511
|
return -1;
|
|
1514
1512
|
}
|
|
1515
1513
|
|
|
1516
|
-
static PyObject *Nuitka_Generator_get_frame(
|
|
1514
|
+
static PyObject *Nuitka_Generator_get_frame(PyObject *self, void *data) {
|
|
1517
1515
|
PyObject *result;
|
|
1518
1516
|
|
|
1517
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1519
1518
|
if (generator->m_frame) {
|
|
1520
1519
|
result = (PyObject *)generator->m_frame;
|
|
1521
1520
|
} else {
|
|
@@ -1526,19 +1525,20 @@ static PyObject *Nuitka_Generator_get_frame(struct Nuitka_GeneratorObject *gener
|
|
|
1526
1525
|
return result;
|
|
1527
1526
|
}
|
|
1528
1527
|
|
|
1529
|
-
static int Nuitka_Generator_set_frame(
|
|
1528
|
+
static int Nuitka_Generator_set_frame(PyObject *self, PyObject *value, void *data) {
|
|
1530
1529
|
PyThreadState *tstate = PyThreadState_GET();
|
|
1531
1530
|
|
|
1532
1531
|
SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_RuntimeError, "gi_frame is not writable in Nuitka");
|
|
1533
1532
|
return -1;
|
|
1534
1533
|
}
|
|
1535
1534
|
|
|
1536
|
-
static PyObject *Nuitka_Generator_get_running(
|
|
1535
|
+
static PyObject *Nuitka_Generator_get_running(PyObject *self, void *data) {
|
|
1537
1536
|
PyObject *result;
|
|
1538
1537
|
|
|
1538
|
+
struct Nuitka_GeneratorObject *generator = (struct Nuitka_GeneratorObject *)self;
|
|
1539
1539
|
/* The type of "gi_running" changed in Python3. */
|
|
1540
1540
|
#if PYTHON_VERSION < 0x300
|
|
1541
|
-
result =
|
|
1541
|
+
result = Nuitka_PyInt_FromLong(generator->m_running);
|
|
1542
1542
|
#else
|
|
1543
1543
|
result = BOOL_FROM(generator->m_running != 0);
|
|
1544
1544
|
Py_INCREF_IMMORTAL(result);
|
|
@@ -1546,7 +1546,7 @@ static PyObject *Nuitka_Generator_get_running(struct Nuitka_GeneratorObject *gen
|
|
|
1546
1546
|
return result;
|
|
1547
1547
|
}
|
|
1548
1548
|
|
|
1549
|
-
static int Nuitka_Generator_set_running(
|
|
1549
|
+
static int Nuitka_Generator_set_running(PyObject *self, PyObject *value, void *data) {
|
|
1550
1550
|
#if PYTHON_VERSION < 0x300
|
|
1551
1551
|
PyObject *exception_type = PyExc_TypeError;
|
|
1552
1552
|
#else
|
|
@@ -1564,17 +1564,19 @@ static int Nuitka_Generator_set_running(struct Nuitka_GeneratorObject *generator
|
|
|
1564
1564
|
return -1;
|
|
1565
1565
|
}
|
|
1566
1566
|
|
|
1567
|
+
// spell-checker: ignore gi_yieldfrom
|
|
1568
|
+
|
|
1567
1569
|
static PyGetSetDef Nuitka_Generator_tp_getset[] = {
|
|
1568
1570
|
#if PYTHON_VERSION < 0x350
|
|
1569
|
-
{(char *)"__name__",
|
|
1571
|
+
{(char *)"__name__", Nuitka_Generator_get_name, NULL, NULL},
|
|
1570
1572
|
#else
|
|
1571
|
-
{(char *)"__name__",
|
|
1572
|
-
{(char *)"__qualname__",
|
|
1573
|
-
{(char *)"gi_yieldfrom",
|
|
1573
|
+
{(char *)"__name__", Nuitka_Generator_get_name, Nuitka_Generator_set_name, NULL},
|
|
1574
|
+
{(char *)"__qualname__", Nuitka_Generator_get_qualname, Nuitka_Generator_set_qualname, NULL},
|
|
1575
|
+
{(char *)"gi_yieldfrom", Nuitka_Generator_get_yield_from, NULL, NULL},
|
|
1574
1576
|
#endif
|
|
1575
|
-
{(char *)"gi_code",
|
|
1576
|
-
{(char *)"gi_frame",
|
|
1577
|
-
{(char *)"gi_running",
|
|
1577
|
+
{(char *)"gi_code", Nuitka_Generator_get_code, Nuitka_Generator_set_code, NULL},
|
|
1578
|
+
{(char *)"gi_frame", Nuitka_Generator_get_frame, Nuitka_Generator_set_frame, NULL},
|
|
1579
|
+
{(char *)"gi_running", Nuitka_Generator_get_running, Nuitka_Generator_set_running, NULL},
|
|
1578
1580
|
|
|
1579
1581
|
{NULL}};
|
|
1580
1582
|
|
|
@@ -1617,7 +1619,7 @@ PyTypeObject Nuitka_Generator_Type = {
|
|
|
1617
1619
|
0, // tp_getattro (PyObject_GenericGetAttr)
|
|
1618
1620
|
0, // tp_setattro
|
|
1619
1621
|
0, // tp_as_buffer
|
|
1620
|
-
#if PYTHON_VERSION <
|
|
1622
|
+
#if PYTHON_VERSION < 0x300
|
|
1621
1623
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
|
|
1622
1624
|
#else
|
|
1623
1625
|
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
|