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
nuitka/nodes/ExceptionNodes.py
CHANGED
|
@@ -5,15 +5,16 @@
|
|
|
5
5
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
from .
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
from nuitka.PythonVersions import python_version
|
|
9
|
+
|
|
10
|
+
from .ChildrenHavingMixins import ChildHavingExceptionTypeMixin
|
|
11
11
|
from .ExpressionBases import ExpressionBase, ExpressionNoSideEffectsMixin
|
|
12
12
|
from .ExpressionBasesGenerated import (
|
|
13
|
+
ExpressionBuiltinMakeExceptionAttributeErrorBase,
|
|
13
14
|
ExpressionBuiltinMakeExceptionBase,
|
|
14
15
|
ExpressionBuiltinMakeExceptionImportErrorBase,
|
|
15
16
|
)
|
|
16
|
-
from .NodeBases import StatementBase
|
|
17
|
+
from .NodeBases import SideEffectsFromChildrenMixin, StatementBase
|
|
17
18
|
from .StatementBasesGenerated import StatementRaiseExceptionBase
|
|
18
19
|
|
|
19
20
|
|
|
@@ -67,14 +68,6 @@ class StatementRaiseException(
|
|
|
67
68
|
return "exception raise statement"
|
|
68
69
|
|
|
69
70
|
|
|
70
|
-
class StatementRaiseExceptionImplicit(StatementRaiseException):
|
|
71
|
-
kind = "STATEMENT_RAISE_EXCEPTION_IMPLICIT"
|
|
72
|
-
|
|
73
|
-
@staticmethod
|
|
74
|
-
def getStatementNiceName():
|
|
75
|
-
return "implicit exception raise statement"
|
|
76
|
-
|
|
77
|
-
|
|
78
71
|
class StatementReraiseException(StatementRaiseExceptionMixin, StatementBase):
|
|
79
72
|
kind = "STATEMENT_RERAISE_EXCEPTION"
|
|
80
73
|
|
|
@@ -97,9 +90,7 @@ class StatementReraiseException(StatementRaiseExceptionMixin, StatementBase):
|
|
|
97
90
|
return "exception re-raise statement"
|
|
98
91
|
|
|
99
92
|
|
|
100
|
-
class ExpressionRaiseException(
|
|
101
|
-
ChildrenHavingExceptionTypeExceptionValueMixin, ExpressionBase
|
|
102
|
-
):
|
|
93
|
+
class ExpressionRaiseException(ChildHavingExceptionTypeMixin, ExpressionBase):
|
|
103
94
|
"""This node type is only produced via optimization.
|
|
104
95
|
|
|
105
96
|
CPython only knows exception raising as a statement, but often the raising
|
|
@@ -109,13 +100,12 @@ class ExpressionRaiseException(
|
|
|
109
100
|
|
|
110
101
|
kind = "EXPRESSION_RAISE_EXCEPTION"
|
|
111
102
|
|
|
112
|
-
named_children = ("exception_type",
|
|
103
|
+
named_children = ("exception_type",)
|
|
113
104
|
|
|
114
|
-
def __init__(self, exception_type,
|
|
115
|
-
|
|
105
|
+
def __init__(self, exception_type, source_ref):
|
|
106
|
+
ChildHavingExceptionTypeMixin.__init__(
|
|
116
107
|
self,
|
|
117
108
|
exception_type=exception_type,
|
|
118
|
-
exception_value=exception_value,
|
|
119
109
|
)
|
|
120
110
|
|
|
121
111
|
ExpressionBase.__init__(self, source_ref)
|
|
@@ -142,9 +132,9 @@ Propagated implicit raise expression to raise statement.""",
|
|
|
142
132
|
)
|
|
143
133
|
|
|
144
134
|
def asStatement(self):
|
|
145
|
-
return
|
|
135
|
+
return StatementRaiseException(
|
|
146
136
|
exception_type=self.subnode_exception_type,
|
|
147
|
-
exception_value=
|
|
137
|
+
exception_value=None,
|
|
148
138
|
exception_trace=None,
|
|
149
139
|
exception_cause=None,
|
|
150
140
|
source_ref=self.source_ref,
|
|
@@ -156,18 +146,19 @@ class ExpressionBuiltinMakeException(ExpressionBuiltinMakeExceptionBase):
|
|
|
156
146
|
|
|
157
147
|
named_children = ("args|tuple",)
|
|
158
148
|
|
|
159
|
-
__slots__ = ("exception_name",)
|
|
149
|
+
__slots__ = ("exception_name", "for_raise")
|
|
160
150
|
|
|
161
151
|
# There is nothing to compute for it as a value.
|
|
162
152
|
auto_compute_handling = "final,no_raise"
|
|
163
153
|
|
|
164
|
-
def __init__(self, exception_name, args, source_ref):
|
|
154
|
+
def __init__(self, exception_name, args, for_raise, source_ref):
|
|
165
155
|
ExpressionBuiltinMakeExceptionBase.__init__(self, args, source_ref=source_ref)
|
|
166
156
|
|
|
167
157
|
self.exception_name = exception_name
|
|
158
|
+
self.for_raise = for_raise
|
|
168
159
|
|
|
169
160
|
def getDetails(self):
|
|
170
|
-
return {"exception_name": self.exception_name}
|
|
161
|
+
return {"exception_name": self.exception_name, "for_raise": self.for_raise}
|
|
171
162
|
|
|
172
163
|
def getExceptionName(self):
|
|
173
164
|
return self.exception_name
|
|
@@ -188,7 +179,7 @@ class ExpressionBuiltinMakeException(ExpressionBuiltinMakeExceptionBase):
|
|
|
188
179
|
|
|
189
180
|
|
|
190
181
|
class ExpressionBuiltinMakeExceptionImportError(
|
|
191
|
-
ExpressionBuiltinMakeExceptionImportErrorBase
|
|
182
|
+
SideEffectsFromChildrenMixin, ExpressionBuiltinMakeExceptionImportErrorBase
|
|
192
183
|
):
|
|
193
184
|
"""Python3 ImportError dedicated node with extra arguments."""
|
|
194
185
|
|
|
@@ -196,11 +187,15 @@ class ExpressionBuiltinMakeExceptionImportError(
|
|
|
196
187
|
|
|
197
188
|
named_children = ("args|tuple", "name|optional", "path|optional")
|
|
198
189
|
|
|
199
|
-
|
|
190
|
+
node_attributes = ("for_raise",)
|
|
191
|
+
|
|
192
|
+
__slots__ = ()
|
|
200
193
|
|
|
201
194
|
# There is nothing to compute for it as a value.
|
|
202
195
|
auto_compute_handling = "final,no_raise"
|
|
203
196
|
|
|
197
|
+
python_version_spec = ">= 0x300"
|
|
198
|
+
|
|
204
199
|
@staticmethod
|
|
205
200
|
def getExceptionName():
|
|
206
201
|
return "ImportError"
|
|
@@ -225,11 +220,50 @@ class ExpressionBuiltinMakeExceptionModuleNotFoundError(
|
|
|
225
220
|
):
|
|
226
221
|
kind = "EXPRESSION_BUILTIN_MAKE_EXCEPTION_MODULE_NOT_FOUND_ERROR"
|
|
227
222
|
|
|
223
|
+
python_version_spec = ">= 0x360"
|
|
224
|
+
|
|
228
225
|
@staticmethod
|
|
229
226
|
def getExceptionName():
|
|
230
227
|
return "ModuleNotFoundError"
|
|
231
228
|
|
|
232
229
|
|
|
230
|
+
class ExpressionBuiltinMakeExceptionAttributeError(
|
|
231
|
+
SideEffectsFromChildrenMixin, ExpressionBuiltinMakeExceptionAttributeErrorBase
|
|
232
|
+
):
|
|
233
|
+
"""Python3 ImportError dedicated node with extra arguments."""
|
|
234
|
+
|
|
235
|
+
kind = "EXPRESSION_BUILTIN_MAKE_EXCEPTION_ATTRIBUTE_ERROR"
|
|
236
|
+
|
|
237
|
+
named_children = ("args|tuple", "name|optional", "obj|optional")
|
|
238
|
+
|
|
239
|
+
node_attributes = ("for_raise",)
|
|
240
|
+
|
|
241
|
+
__slots__ = ()
|
|
242
|
+
|
|
243
|
+
# There is nothing to compute for it as a value.
|
|
244
|
+
auto_compute_handling = "final,no_raise"
|
|
245
|
+
|
|
246
|
+
python_version_spec = ">= 0x3a0"
|
|
247
|
+
|
|
248
|
+
@staticmethod
|
|
249
|
+
def getExceptionName():
|
|
250
|
+
return "AttributeError"
|
|
251
|
+
|
|
252
|
+
def computeExpression(self, trace_collection):
|
|
253
|
+
return self, None, None
|
|
254
|
+
|
|
255
|
+
def mayRaiseException(self, exception_type):
|
|
256
|
+
for arg in self.subnode_args:
|
|
257
|
+
if arg.mayRaiseException(exception_type):
|
|
258
|
+
return True
|
|
259
|
+
|
|
260
|
+
return False
|
|
261
|
+
|
|
262
|
+
@staticmethod
|
|
263
|
+
def mayRaiseExceptionOperation():
|
|
264
|
+
return False
|
|
265
|
+
|
|
266
|
+
|
|
233
267
|
class ExpressionCaughtMixin(ExpressionNoSideEffectsMixin):
|
|
234
268
|
"""Common things for all caught exception references."""
|
|
235
269
|
|
|
@@ -271,6 +305,48 @@ class ExpressionCaughtExceptionTracebackRef(ExpressionCaughtMixin, ExpressionBas
|
|
|
271
305
|
return self, None, None
|
|
272
306
|
|
|
273
307
|
|
|
308
|
+
def makeBuiltinMakeExceptionNode(
|
|
309
|
+
exception_name, args, for_raise, name=None, path=None, obj=None, source_ref=None
|
|
310
|
+
):
|
|
311
|
+
assert type(exception_name) is str, exception_name
|
|
312
|
+
|
|
313
|
+
if exception_name == "ImportError" and python_version >= 0x300:
|
|
314
|
+
return ExpressionBuiltinMakeExceptionImportError(
|
|
315
|
+
args=args,
|
|
316
|
+
name=name,
|
|
317
|
+
path=path,
|
|
318
|
+
for_raise=for_raise,
|
|
319
|
+
source_ref=source_ref,
|
|
320
|
+
)
|
|
321
|
+
elif exception_name == "ModuleNotFoundError" and python_version >= 0x360:
|
|
322
|
+
return ExpressionBuiltinMakeExceptionModuleNotFoundError(
|
|
323
|
+
args=args,
|
|
324
|
+
name=name,
|
|
325
|
+
path=path,
|
|
326
|
+
for_raise=for_raise,
|
|
327
|
+
source_ref=source_ref,
|
|
328
|
+
)
|
|
329
|
+
elif exception_name == "AttributeError" and python_version >= 0x3A0:
|
|
330
|
+
return ExpressionBuiltinMakeExceptionAttributeError(
|
|
331
|
+
args=args,
|
|
332
|
+
name=name,
|
|
333
|
+
obj=obj,
|
|
334
|
+
for_raise=for_raise,
|
|
335
|
+
source_ref=source_ref,
|
|
336
|
+
)
|
|
337
|
+
else:
|
|
338
|
+
# We expect to only get the star arguments for these.
|
|
339
|
+
assert name is None
|
|
340
|
+
assert path is None
|
|
341
|
+
|
|
342
|
+
return ExpressionBuiltinMakeException(
|
|
343
|
+
exception_name=exception_name,
|
|
344
|
+
args=args,
|
|
345
|
+
for_raise=for_raise,
|
|
346
|
+
source_ref=source_ref,
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
|
|
274
350
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
275
351
|
# integrates with CPython, but also works on its own.
|
|
276
352
|
#
|
|
@@ -80,6 +80,80 @@ ExpressionImportlibMetadataBackportEntryPointValueRefBase = (
|
|
|
80
80
|
ExpressionImportlibMetadataEntryPointValueRefBase = NoChildHavingFinalNoRaiseMixin
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
class NoChildHavingFinalNoRaiseNameMixin(ExpressionBase):
|
|
84
|
+
# Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
|
|
85
|
+
__slots__ = ()
|
|
86
|
+
|
|
87
|
+
# This is generated for use in
|
|
88
|
+
# ExpressionTypeVariable
|
|
89
|
+
|
|
90
|
+
def __init__(self, name, source_ref):
|
|
91
|
+
self.name = name
|
|
92
|
+
|
|
93
|
+
ExpressionBase.__init__(self, source_ref)
|
|
94
|
+
|
|
95
|
+
def getDetails(self):
|
|
96
|
+
return {
|
|
97
|
+
"name": self.name,
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
def getVisitableNodes(self):
|
|
101
|
+
"""The visitable nodes, with tuple values flattened."""
|
|
102
|
+
|
|
103
|
+
return ()
|
|
104
|
+
|
|
105
|
+
def getVisitableNodesNamed(self):
|
|
106
|
+
"""Named children dictionary.
|
|
107
|
+
|
|
108
|
+
For use in cloning nodes, debugging and XML output.
|
|
109
|
+
"""
|
|
110
|
+
|
|
111
|
+
return ()
|
|
112
|
+
|
|
113
|
+
def replaceChild(self, old_node, new_node):
|
|
114
|
+
raise AssertionError("Didn't find child", old_node, "in", self)
|
|
115
|
+
|
|
116
|
+
def getCloneArgs(self):
|
|
117
|
+
"""Get clones of all children to pass for a new node.
|
|
118
|
+
|
|
119
|
+
Needs to make clones of child nodes too.
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
values = {}
|
|
123
|
+
|
|
124
|
+
values.update(self.getDetails())
|
|
125
|
+
|
|
126
|
+
return values
|
|
127
|
+
|
|
128
|
+
def finalize(self):
|
|
129
|
+
del self.parent
|
|
130
|
+
|
|
131
|
+
def computeExpressionRaw(self, trace_collection):
|
|
132
|
+
"""Compute an expression.
|
|
133
|
+
|
|
134
|
+
Default behavior is to just visit the child expressions first, and
|
|
135
|
+
then the node "computeExpression". For a few cases this needs to
|
|
136
|
+
be overloaded, e.g. conditional expressions.
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
return self, None, None
|
|
140
|
+
|
|
141
|
+
@staticmethod
|
|
142
|
+
def mayRaiseExceptionOperation():
|
|
143
|
+
return False
|
|
144
|
+
|
|
145
|
+
@staticmethod
|
|
146
|
+
def mayRaiseException(exception_type):
|
|
147
|
+
return False
|
|
148
|
+
|
|
149
|
+
def collectVariableAccesses(self, emit_read, emit_write):
|
|
150
|
+
"""Collect variable reads and writes of child nodes."""
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
# Assign the names that are easier to import with a stable name.
|
|
154
|
+
ExpressionTypeVariableBase = NoChildHavingFinalNoRaiseNameMixin
|
|
155
|
+
|
|
156
|
+
|
|
83
157
|
class ChildHavingArgsTupleFinalNoRaiseMixin(ExpressionBase):
|
|
84
158
|
# Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
|
|
85
159
|
__slots__ = ()
|
|
@@ -200,7 +274,210 @@ class ChildHavingArgsTupleFinalNoRaiseMixin(ExpressionBase):
|
|
|
200
274
|
ExpressionBuiltinMakeExceptionBase = ChildHavingArgsTupleFinalNoRaiseMixin
|
|
201
275
|
|
|
202
276
|
|
|
203
|
-
class
|
|
277
|
+
class ChildrenHavingArgsTupleNameOptionalObjOptionalFinalNoRaiseForRaiseMixin(
|
|
278
|
+
ExpressionBase
|
|
279
|
+
):
|
|
280
|
+
# Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
|
|
281
|
+
__slots__ = ()
|
|
282
|
+
|
|
283
|
+
# This is generated for use in
|
|
284
|
+
# ExpressionBuiltinMakeExceptionAttributeError
|
|
285
|
+
|
|
286
|
+
def __init__(self, args, name, obj, for_raise, source_ref):
|
|
287
|
+
assert type(args) is tuple
|
|
288
|
+
|
|
289
|
+
for val in args:
|
|
290
|
+
val.parent = self
|
|
291
|
+
|
|
292
|
+
self.subnode_args = args
|
|
293
|
+
|
|
294
|
+
if name is not None:
|
|
295
|
+
name.parent = self
|
|
296
|
+
|
|
297
|
+
self.subnode_name = name
|
|
298
|
+
|
|
299
|
+
if obj is not None:
|
|
300
|
+
obj.parent = self
|
|
301
|
+
|
|
302
|
+
self.subnode_obj = obj
|
|
303
|
+
|
|
304
|
+
self.for_raise = for_raise
|
|
305
|
+
|
|
306
|
+
ExpressionBase.__init__(self, source_ref)
|
|
307
|
+
|
|
308
|
+
def getDetails(self):
|
|
309
|
+
return {
|
|
310
|
+
"for_raise": self.for_raise,
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
def getVisitableNodes(self):
|
|
314
|
+
"""The visitable nodes, with tuple values flattened."""
|
|
315
|
+
|
|
316
|
+
result = []
|
|
317
|
+
result.extend(self.subnode_args)
|
|
318
|
+
value = self.subnode_name
|
|
319
|
+
if value is None:
|
|
320
|
+
pass
|
|
321
|
+
else:
|
|
322
|
+
result.append(value)
|
|
323
|
+
value = self.subnode_obj
|
|
324
|
+
if value is None:
|
|
325
|
+
pass
|
|
326
|
+
else:
|
|
327
|
+
result.append(value)
|
|
328
|
+
return tuple(result)
|
|
329
|
+
|
|
330
|
+
def getVisitableNodesNamed(self):
|
|
331
|
+
"""Named children dictionary.
|
|
332
|
+
|
|
333
|
+
For use in cloning nodes, debugging and XML output.
|
|
334
|
+
"""
|
|
335
|
+
|
|
336
|
+
return (
|
|
337
|
+
("args", self.subnode_args),
|
|
338
|
+
("name", self.subnode_name),
|
|
339
|
+
("obj", self.subnode_obj),
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
def replaceChild(self, old_node, new_node):
|
|
343
|
+
value = self.subnode_args
|
|
344
|
+
if old_node in value:
|
|
345
|
+
if new_node is not None:
|
|
346
|
+
new_node.parent = self
|
|
347
|
+
|
|
348
|
+
self.subnode_args = tuple(
|
|
349
|
+
(val if val is not old_node else new_node) for val in value
|
|
350
|
+
)
|
|
351
|
+
else:
|
|
352
|
+
self.subnode_args = tuple(val for val in value if val is not old_node)
|
|
353
|
+
|
|
354
|
+
return
|
|
355
|
+
|
|
356
|
+
value = self.subnode_name
|
|
357
|
+
if old_node is value:
|
|
358
|
+
if new_node is not None:
|
|
359
|
+
new_node.parent = self
|
|
360
|
+
|
|
361
|
+
self.subnode_name = new_node
|
|
362
|
+
|
|
363
|
+
return
|
|
364
|
+
|
|
365
|
+
value = self.subnode_obj
|
|
366
|
+
if old_node is value:
|
|
367
|
+
if new_node is not None:
|
|
368
|
+
new_node.parent = self
|
|
369
|
+
|
|
370
|
+
self.subnode_obj = new_node
|
|
371
|
+
|
|
372
|
+
return
|
|
373
|
+
|
|
374
|
+
raise AssertionError("Didn't find child", old_node, "in", self)
|
|
375
|
+
|
|
376
|
+
def getCloneArgs(self):
|
|
377
|
+
"""Get clones of all children to pass for a new node.
|
|
378
|
+
|
|
379
|
+
Needs to make clones of child nodes too.
|
|
380
|
+
"""
|
|
381
|
+
|
|
382
|
+
values = {
|
|
383
|
+
"args": tuple(v.makeClone() for v in self.subnode_args),
|
|
384
|
+
"name": (
|
|
385
|
+
self.subnode_name.makeClone() if self.subnode_name is not None else None
|
|
386
|
+
),
|
|
387
|
+
"obj": (
|
|
388
|
+
self.subnode_obj.makeClone() if self.subnode_obj is not None else None
|
|
389
|
+
),
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
values.update(self.getDetails())
|
|
393
|
+
|
|
394
|
+
return values
|
|
395
|
+
|
|
396
|
+
def finalize(self):
|
|
397
|
+
del self.parent
|
|
398
|
+
|
|
399
|
+
for c in self.subnode_args:
|
|
400
|
+
c.finalize()
|
|
401
|
+
del self.subnode_args
|
|
402
|
+
if self.subnode_name is not None:
|
|
403
|
+
self.subnode_name.finalize()
|
|
404
|
+
del self.subnode_name
|
|
405
|
+
if self.subnode_obj is not None:
|
|
406
|
+
self.subnode_obj.finalize()
|
|
407
|
+
del self.subnode_obj
|
|
408
|
+
|
|
409
|
+
def computeExpressionRaw(self, trace_collection):
|
|
410
|
+
"""Compute an expression.
|
|
411
|
+
|
|
412
|
+
Default behavior is to just visit the child expressions first, and
|
|
413
|
+
then the node "computeExpression". For a few cases this needs to
|
|
414
|
+
be overloaded, e.g. conditional expressions.
|
|
415
|
+
"""
|
|
416
|
+
|
|
417
|
+
# First apply the sub-expressions, as they are evaluated before
|
|
418
|
+
# the actual operation.
|
|
419
|
+
for count, sub_expression in enumerate(self.getVisitableNodes()):
|
|
420
|
+
expression = trace_collection.onExpression(sub_expression)
|
|
421
|
+
|
|
422
|
+
if expression.willRaiseAnyException():
|
|
423
|
+
sub_expressions = self.getVisitableNodes()
|
|
424
|
+
|
|
425
|
+
wrapped_expression = wrapExpressionWithSideEffects(
|
|
426
|
+
side_effects=sub_expressions[:count],
|
|
427
|
+
old_node=sub_expression,
|
|
428
|
+
new_node=expression,
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
return (
|
|
432
|
+
wrapped_expression,
|
|
433
|
+
"new_raise",
|
|
434
|
+
lambda: "For '%s' the child expression '%s' will raise."
|
|
435
|
+
% (self.getChildNameNice(), expression.getChildNameNice()),
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
return self, None, None
|
|
439
|
+
|
|
440
|
+
@staticmethod
|
|
441
|
+
def mayRaiseExceptionOperation():
|
|
442
|
+
return False
|
|
443
|
+
|
|
444
|
+
def mayRaiseException(self, exception_type):
|
|
445
|
+
return (
|
|
446
|
+
any(value.mayRaiseException(exception_type) for value in self.subnode_args)
|
|
447
|
+
or (
|
|
448
|
+
self.subnode_name is not None
|
|
449
|
+
and self.subnode_name.mayRaiseException(exception_type)
|
|
450
|
+
)
|
|
451
|
+
or (
|
|
452
|
+
self.subnode_obj is not None
|
|
453
|
+
and self.subnode_obj.mayRaiseException(exception_type)
|
|
454
|
+
)
|
|
455
|
+
)
|
|
456
|
+
|
|
457
|
+
def collectVariableAccesses(self, emit_read, emit_write):
|
|
458
|
+
"""Collect variable reads and writes of child nodes."""
|
|
459
|
+
|
|
460
|
+
for element in self.subnode_args:
|
|
461
|
+
element.collectVariableAccesses(emit_read, emit_write)
|
|
462
|
+
subnode_name = self.subnode_name
|
|
463
|
+
|
|
464
|
+
if subnode_name is not None:
|
|
465
|
+
self.subnode_name.collectVariableAccesses(emit_read, emit_write)
|
|
466
|
+
subnode_obj = self.subnode_obj
|
|
467
|
+
|
|
468
|
+
if subnode_obj is not None:
|
|
469
|
+
self.subnode_obj.collectVariableAccesses(emit_read, emit_write)
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
# Assign the names that are easier to import with a stable name.
|
|
473
|
+
ExpressionBuiltinMakeExceptionAttributeErrorBase = (
|
|
474
|
+
ChildrenHavingArgsTupleNameOptionalObjOptionalFinalNoRaiseForRaiseMixin
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseForRaiseMixin(
|
|
479
|
+
ExpressionBase
|
|
480
|
+
):
|
|
204
481
|
# Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
|
|
205
482
|
__slots__ = ()
|
|
206
483
|
|
|
@@ -208,7 +485,7 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
|
|
|
208
485
|
# ExpressionBuiltinMakeExceptionImportError
|
|
209
486
|
# ExpressionBuiltinMakeExceptionModuleNotFoundError
|
|
210
487
|
|
|
211
|
-
def __init__(self, args, name, path, source_ref):
|
|
488
|
+
def __init__(self, args, name, path, for_raise, source_ref):
|
|
212
489
|
assert type(args) is tuple
|
|
213
490
|
|
|
214
491
|
for val in args:
|
|
@@ -226,8 +503,15 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
|
|
|
226
503
|
|
|
227
504
|
self.subnode_path = path
|
|
228
505
|
|
|
506
|
+
self.for_raise = for_raise
|
|
507
|
+
|
|
229
508
|
ExpressionBase.__init__(self, source_ref)
|
|
230
509
|
|
|
510
|
+
def getDetails(self):
|
|
511
|
+
return {
|
|
512
|
+
"for_raise": self.for_raise,
|
|
513
|
+
}
|
|
514
|
+
|
|
231
515
|
def getVisitableNodes(self):
|
|
232
516
|
"""The visitable nodes, with tuple values flattened."""
|
|
233
517
|
|
|
@@ -389,10 +673,10 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
|
|
|
389
673
|
|
|
390
674
|
# Assign the names that are easier to import with a stable name.
|
|
391
675
|
ExpressionBuiltinMakeExceptionImportErrorBase = (
|
|
392
|
-
|
|
676
|
+
ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseForRaiseMixin
|
|
393
677
|
)
|
|
394
678
|
ExpressionBuiltinMakeExceptionModuleNotFoundErrorBase = (
|
|
395
|
-
|
|
679
|
+
ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseForRaiseMixin
|
|
396
680
|
)
|
|
397
681
|
|
|
398
682
|
|
nuitka/nodes/FrameNodes.py
CHANGED
|
@@ -18,7 +18,8 @@ from nuitka.PythonVersions import python_version
|
|
|
18
18
|
|
|
19
19
|
from .CodeObjectSpecs import CodeObjectSpec
|
|
20
20
|
from .FutureSpecs import fromFlags
|
|
21
|
-
from .
|
|
21
|
+
from .StatementBasesGenerated import StatementsSequenceBase
|
|
22
|
+
from .StatementNodes import StatementsSequenceMixin
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
def checkFrameStatements(value):
|
|
@@ -33,30 +34,39 @@ def checkFrameStatements(value):
|
|
|
33
34
|
return tuple(value)
|
|
34
35
|
|
|
35
36
|
|
|
36
|
-
class StatementsFrameBase(
|
|
37
|
+
class StatementsFrameBase(StatementsSequenceMixin, StatementsSequenceBase):
|
|
37
38
|
checkers = {"statements": checkFrameStatements}
|
|
38
39
|
|
|
39
40
|
__slots__ = ("code_object", "needs_frame_exception_preserve")
|
|
40
41
|
|
|
42
|
+
named_children = ("statements|tuple+setter",)
|
|
43
|
+
|
|
41
44
|
def __init__(self, statements, code_object, source_ref):
|
|
42
|
-
|
|
45
|
+
StatementsSequenceBase.__init__(
|
|
46
|
+
self, statements=statements, source_ref=source_ref
|
|
47
|
+
)
|
|
43
48
|
|
|
44
49
|
self.code_object = code_object
|
|
45
50
|
|
|
46
51
|
self.needs_frame_exception_preserve = False
|
|
47
52
|
|
|
48
|
-
|
|
53
|
+
@staticmethod
|
|
54
|
+
def isStatementsFrame():
|
|
55
|
+
return True
|
|
56
|
+
|
|
57
|
+
@staticmethod
|
|
58
|
+
def isStatementsSequence():
|
|
49
59
|
return True
|
|
50
60
|
|
|
51
61
|
def getDetails(self):
|
|
52
62
|
result = {"code_object": self.code_object}
|
|
53
63
|
|
|
54
|
-
result.update(
|
|
64
|
+
result.update(StatementsSequenceBase.getDetails(self))
|
|
55
65
|
|
|
56
66
|
return result
|
|
57
67
|
|
|
58
68
|
def getDetailsForDisplay(self):
|
|
59
|
-
result =
|
|
69
|
+
result = StatementsSequenceBase.getDetails(self)
|
|
60
70
|
result.update()
|
|
61
71
|
|
|
62
72
|
result.update(self.code_object.getDetails())
|
|
@@ -139,7 +149,7 @@ class StatementsFrameBase(StatementsSequence):
|
|
|
139
149
|
self.code_object.setFlagIsOptimizedValue(is_optimized)
|
|
140
150
|
|
|
141
151
|
new_locals = not provider.isCompiledPythonModule() and (
|
|
142
|
-
python_version <
|
|
152
|
+
python_version < 0x300
|
|
143
153
|
or (
|
|
144
154
|
not provider.isExpressionClassBodyBase()
|
|
145
155
|
and not provider.isUnoptimized()
|
|
@@ -174,10 +184,7 @@ class StatementsFrameBase(StatementsSequence):
|
|
|
174
184
|
new_statement = trace_collection.onStatement(statement=statement)
|
|
175
185
|
|
|
176
186
|
if new_statement is not None:
|
|
177
|
-
if (
|
|
178
|
-
new_statement.isStatementsSequence()
|
|
179
|
-
and not new_statement.isStatementsFrame()
|
|
180
|
-
):
|
|
187
|
+
if new_statement.isStatementsSequenceButNotFrame():
|
|
181
188
|
new_statements.extend(new_statement.subnode_statements)
|
|
182
189
|
else:
|
|
183
190
|
new_statements.append(new_statement)
|
|
@@ -265,6 +272,10 @@ class StatementsFrameBase(StatementsSequence):
|
|
|
265
272
|
|
|
266
273
|
return None
|
|
267
274
|
|
|
275
|
+
@staticmethod
|
|
276
|
+
def getStatementNiceName():
|
|
277
|
+
return "frame statements sequence"
|
|
278
|
+
|
|
268
279
|
|
|
269
280
|
class StatementsFrameModule(StatementsFrameBase):
|
|
270
281
|
kind = "STATEMENTS_FRAME_MODULE"
|
nuitka/nodes/FunctionNodes.py
CHANGED
|
@@ -344,7 +344,7 @@ class ExpressionFunctionBodyBase(
|
|
|
344
344
|
|
|
345
345
|
function_name = self.getFunctionName()
|
|
346
346
|
|
|
347
|
-
if python_version <
|
|
347
|
+
if python_version < 0x300:
|
|
348
348
|
qualname_provider = self.getParentVariableProvider()
|
|
349
349
|
else:
|
|
350
350
|
qualname_provider = self.qualname_provider
|
|
@@ -1028,7 +1028,7 @@ class ExpressionFunctionCreationOld(
|
|
|
1028
1028
|
):
|
|
1029
1029
|
kind = "EXPRESSION_FUNCTION_CREATION_OLD"
|
|
1030
1030
|
|
|
1031
|
-
python_version_spec = "<
|
|
1031
|
+
python_version_spec = "< 0x300"
|
|
1032
1032
|
# Note: The order of evaluation for these is a bit unexpected, but
|
|
1033
1033
|
# true. Keyword defaults go first, then normal defaults, and annotations of
|
|
1034
1034
|
# all kinds go last.
|
|
@@ -1096,7 +1096,7 @@ class ExpressionFunctionCreation(
|
|
|
1096
1096
|
self.variable_closure_traces = None
|
|
1097
1097
|
|
|
1098
1098
|
|
|
1099
|
-
if python_version <
|
|
1099
|
+
if python_version < 0x300:
|
|
1100
1100
|
ExpressionFunctionCreation = ExpressionFunctionCreationOld
|
|
1101
1101
|
|
|
1102
1102
|
|
nuitka/nodes/GeneratorNodes.py
CHANGED
|
@@ -97,14 +97,11 @@ class ExpressionGeneratorObjectBody(
|
|
|
97
97
|
def getFunctionName(self):
|
|
98
98
|
return self.name
|
|
99
99
|
|
|
100
|
-
def markAsNeedsGeneratorReturnHandling(self
|
|
101
|
-
self.needs_generator_return_exit =
|
|
102
|
-
|
|
103
|
-
def needsGeneratorReturnHandling(self):
|
|
104
|
-
return self.needs_generator_return_exit == 2
|
|
100
|
+
def markAsNeedsGeneratorReturnHandling(self):
|
|
101
|
+
self.needs_generator_return_exit = True
|
|
105
102
|
|
|
106
103
|
def needsGeneratorReturnExit(self):
|
|
107
|
-
return
|
|
104
|
+
return self.needs_generator_return_exit
|
|
108
105
|
|
|
109
106
|
@staticmethod
|
|
110
107
|
def needsCreation():
|