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/OsSysNodes.py
CHANGED
|
@@ -5,18 +5,22 @@
|
|
|
5
5
|
|
|
6
6
|
import os
|
|
7
7
|
|
|
8
|
-
from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
|
|
9
8
|
from .ConstantRefNodes import makeConstantRefNode
|
|
10
|
-
from .ExceptionNodes import
|
|
9
|
+
from .ExceptionNodes import (
|
|
10
|
+
ExpressionRaiseException,
|
|
11
|
+
makeBuiltinMakeExceptionNode,
|
|
12
|
+
)
|
|
11
13
|
from .ExpressionBases import ExpressionNoSideEffectsMixin
|
|
12
14
|
from .HardImportNodesGenerated import (
|
|
13
15
|
ExpressionOsListdirCallBase,
|
|
16
|
+
ExpressionOsLstatCallBase,
|
|
14
17
|
ExpressionOsPathAbspathCallBase,
|
|
15
18
|
ExpressionOsPathBasenameCallBase,
|
|
16
19
|
ExpressionOsPathExistsCallBase,
|
|
17
20
|
ExpressionOsPathIsabsCallBase,
|
|
18
21
|
ExpressionOsPathIsdirCallBase,
|
|
19
22
|
ExpressionOsPathIsfileCallBase,
|
|
23
|
+
ExpressionOsStatCallBase,
|
|
20
24
|
ExpressionOsUnameCallBase,
|
|
21
25
|
)
|
|
22
26
|
|
|
@@ -155,15 +159,42 @@ class ExpressionOsListdirCall(ExpressionOsListdirCallBase):
|
|
|
155
159
|
return self, None, None
|
|
156
160
|
|
|
157
161
|
|
|
162
|
+
class ExpressionOsStatCall(ExpressionOsStatCallBase):
|
|
163
|
+
kind = "EXPRESSION_OS_STAT_CALL"
|
|
164
|
+
|
|
165
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
166
|
+
# Nothing we can do really
|
|
167
|
+
|
|
168
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
169
|
+
|
|
170
|
+
return self, None, None
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class ExpressionOsLstatCall(ExpressionOsLstatCallBase):
|
|
174
|
+
kind = "EXPRESSION_OS_LSTAT_CALL"
|
|
175
|
+
|
|
176
|
+
def replaceWithCompileTimeValue(self, trace_collection):
|
|
177
|
+
# Nothing we can do really
|
|
178
|
+
|
|
179
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
180
|
+
|
|
181
|
+
return self, None, None
|
|
182
|
+
|
|
183
|
+
|
|
158
184
|
def makeExpressionSysExitCall(exit_code, source_ref):
|
|
185
|
+
|
|
159
186
|
if exit_code is None:
|
|
160
|
-
|
|
187
|
+
args = ()
|
|
188
|
+
else:
|
|
189
|
+
args = (exit_code,)
|
|
161
190
|
|
|
162
191
|
return ExpressionRaiseException(
|
|
163
|
-
exception_type=
|
|
164
|
-
exception_name="SystemExit",
|
|
192
|
+
exception_type=makeBuiltinMakeExceptionNode(
|
|
193
|
+
exception_name="SystemExit",
|
|
194
|
+
args=args,
|
|
195
|
+
for_raise=True,
|
|
196
|
+
source_ref=source_ref,
|
|
165
197
|
),
|
|
166
|
-
exception_value=exit_code,
|
|
167
198
|
source_ref=source_ref,
|
|
168
199
|
)
|
|
169
200
|
|
nuitka/nodes/OutlineNodes.py
CHANGED
|
@@ -139,9 +139,9 @@ class ExpressionOutlineBody(ChildHavingBodyOptionalMixin, ExpressionBase):
|
|
|
139
139
|
if first_statement.isStatementRaiseException():
|
|
140
140
|
# Exception exit was already annotated, need not repeat it.
|
|
141
141
|
|
|
142
|
+
assert first_statement.subnode_exception_value is None, first_statement
|
|
142
143
|
result = ExpressionRaiseException(
|
|
143
144
|
exception_type=first_statement.subnode_exception_type,
|
|
144
|
-
exception_value=first_statement.subnode_exception_value,
|
|
145
145
|
source_ref=first_statement.getSourceReference(),
|
|
146
146
|
)
|
|
147
147
|
|
|
@@ -264,9 +264,9 @@ class ExpressionOutlineFunctionBase(ExpressionFunctionBodyBase):
|
|
|
264
264
|
if first_statement.isStatementRaiseException():
|
|
265
265
|
# Exception exit was already annotated, need not repeat it.
|
|
266
266
|
|
|
267
|
+
assert first_statement.subnode_exception_value is None, first_statement
|
|
267
268
|
result = ExpressionRaiseException(
|
|
268
269
|
exception_type=first_statement.subnode_exception_type,
|
|
269
|
-
exception_value=first_statement.subnode_exception_value,
|
|
270
270
|
source_ref=first_statement.getSourceReference(),
|
|
271
271
|
)
|
|
272
272
|
|
|
@@ -690,7 +690,6 @@ class StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOp
|
|
|
690
690
|
|
|
691
691
|
# This is generated for use in
|
|
692
692
|
# StatementRaiseException
|
|
693
|
-
# StatementRaiseExceptionImplicit
|
|
694
693
|
|
|
695
694
|
def __init__(
|
|
696
695
|
self,
|
|
@@ -878,7 +877,6 @@ class StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOp
|
|
|
878
877
|
|
|
879
878
|
# Assign the names that are easier to import with a stable name.
|
|
880
879
|
StatementRaiseExceptionBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin
|
|
881
|
-
StatementRaiseExceptionImplicitBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin
|
|
882
880
|
|
|
883
881
|
|
|
884
882
|
class StatementChildHavingExpressionOperationAttributeNameMixin(StatementBase):
|
nuitka/nodes/StatementNodes.py
CHANGED
|
@@ -27,6 +27,10 @@ class StatementsSequenceMixin(object):
|
|
|
27
27
|
def isStatementsSequence():
|
|
28
28
|
return True
|
|
29
29
|
|
|
30
|
+
def computeStatement(self, trace_collection):
|
|
31
|
+
# Don't want to be called like this.
|
|
32
|
+
assert False, self
|
|
33
|
+
|
|
30
34
|
def trimStatements(self, statement):
|
|
31
35
|
assert statement.parent is self
|
|
32
36
|
|
|
@@ -119,9 +123,9 @@ class StatementsSequence(StatementsSequenceMixin, StatementsSequenceBase):
|
|
|
119
123
|
|
|
120
124
|
named_children = ("statements|tuple+setter",)
|
|
121
125
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
@staticmethod
|
|
127
|
+
def isStatementsSequenceButNotFrame():
|
|
128
|
+
return True
|
|
125
129
|
|
|
126
130
|
def computeStatementsSequence(self, trace_collection):
|
|
127
131
|
new_statements = []
|
|
@@ -137,10 +141,7 @@ class StatementsSequence(StatementsSequenceMixin, StatementsSequenceBase):
|
|
|
137
141
|
new_statement = trace_collection.onStatement(statement=statement)
|
|
138
142
|
|
|
139
143
|
if new_statement is not None:
|
|
140
|
-
if (
|
|
141
|
-
new_statement.isStatementsSequence()
|
|
142
|
-
and not new_statement.isStatementsFrame()
|
|
143
|
-
):
|
|
144
|
+
if new_statement.isStatementsSequenceButNotFrame():
|
|
144
145
|
new_statements.extend(new_statement.subnode_statements)
|
|
145
146
|
else:
|
|
146
147
|
new_statements.append(new_statement)
|
nuitka/nodes/SubscriptNodes.py
CHANGED
|
@@ -195,7 +195,7 @@ class ExpressionSubscriptLookupForUnpack(ExpressionSubscriptLookup):
|
|
|
195
195
|
# Rewrite exceptions to correct message.
|
|
196
196
|
if (
|
|
197
197
|
result_node.isExpressionRaiseException()
|
|
198
|
-
and result_node.subnode_exception_type.
|
|
198
|
+
and result_node.subnode_exception_type.isExpressionBuiltinMakeException()
|
|
199
199
|
and result_node.subnode_exception_type.getExceptionName() == "IndexError"
|
|
200
200
|
):
|
|
201
201
|
if python_version >= 0x360:
|
nuitka/nodes/TypeNodes.py
CHANGED
|
@@ -24,10 +24,14 @@ from .ChildrenHavingMixins import (
|
|
|
24
24
|
ChildrenExpressionBuiltinSuper1Mixin,
|
|
25
25
|
ChildrenExpressionBuiltinSuper2Mixin,
|
|
26
26
|
ChildrenExpressionTypeAliasMixin,
|
|
27
|
+
ChildrenExpressionTypeMakeGenericMixin,
|
|
27
28
|
ChildrenHavingInstanceClassesMixin,
|
|
28
29
|
)
|
|
29
30
|
from .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase
|
|
30
|
-
from .ExpressionBasesGenerated import
|
|
31
|
+
from .ExpressionBasesGenerated import (
|
|
32
|
+
ExpressionSubtypeCheckBase,
|
|
33
|
+
ExpressionTypeVariableBase,
|
|
34
|
+
)
|
|
31
35
|
from .ExpressionShapeMixins import ExpressionBoolShapeExactMixin
|
|
32
36
|
from .NodeBases import SideEffectsFromChildrenMixin
|
|
33
37
|
from .NodeMakingHelpers import (
|
|
@@ -347,6 +351,29 @@ class ExpressionTypeAlias(ChildrenExpressionTypeAliasMixin, ExpressionBase):
|
|
|
347
351
|
return False
|
|
348
352
|
|
|
349
353
|
|
|
354
|
+
class ExpressionTypeVariable(ExpressionTypeVariableBase, ExpressionBase):
|
|
355
|
+
kind = "EXPRESSION_TYPE_VARIABLE"
|
|
356
|
+
|
|
357
|
+
auto_compute_handling = "final,no_raise"
|
|
358
|
+
node_attributes = ("name",)
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
class ExpressionTypeMakeGeneric(ChildrenExpressionTypeMakeGenericMixin, ExpressionBase):
|
|
362
|
+
kind = "EXPRESSION_TYPE_MAKE_GENERIC"
|
|
363
|
+
|
|
364
|
+
named_children = ("type_params",)
|
|
365
|
+
|
|
366
|
+
def __init__(self, type_params, source_ref):
|
|
367
|
+
ChildrenExpressionTypeMakeGenericMixin.__init__(self, type_params=type_params)
|
|
368
|
+
|
|
369
|
+
ExpressionBase.__init__(self, source_ref)
|
|
370
|
+
|
|
371
|
+
def computeExpression(self, trace_collection):
|
|
372
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
373
|
+
|
|
374
|
+
return self, None, None
|
|
375
|
+
|
|
376
|
+
|
|
350
377
|
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
351
378
|
# integrates with CPython, but also works on its own.
|
|
352
379
|
#
|
|
@@ -479,6 +479,12 @@ class ShapeTypeBool(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
|
479
479
|
def isKnownToHaveAttribute(attribute_name):
|
|
480
480
|
return hasattr(True, attribute_name)
|
|
481
481
|
|
|
482
|
+
def getOperationUnaryAddShape(self):
|
|
483
|
+
return tshape_int, ControlFlowDescriptionNoEscape
|
|
484
|
+
|
|
485
|
+
def getOperationUnarySubShape(self):
|
|
486
|
+
return tshape_int, ControlFlowDescriptionNoEscape
|
|
487
|
+
|
|
482
488
|
|
|
483
489
|
tshape_bool = ShapeTypeBool()
|
|
484
490
|
|
|
@@ -492,6 +498,12 @@ class ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
|
492
498
|
def getTypeName():
|
|
493
499
|
return "int"
|
|
494
500
|
|
|
501
|
+
if isExperimental("optimize-dual-int"):
|
|
502
|
+
|
|
503
|
+
@staticmethod
|
|
504
|
+
def getCType():
|
|
505
|
+
return CTypeNuitkaIntOrLongStruct
|
|
506
|
+
|
|
495
507
|
helper_code = "INT" if python_version < 0x300 else "LONG"
|
|
496
508
|
|
|
497
509
|
add_shapes = add_shapes_int
|
|
@@ -536,6 +548,12 @@ class ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
|
536
548
|
def isKnownToHaveAttribute(attribute_name):
|
|
537
549
|
return hasattr(7, attribute_name)
|
|
538
550
|
|
|
551
|
+
def getOperationUnaryAddShape(self):
|
|
552
|
+
return self, ControlFlowDescriptionNoEscape
|
|
553
|
+
|
|
554
|
+
def getOperationUnarySubShape(self):
|
|
555
|
+
return tshape_int_or_long, ControlFlowDescriptionNoEscape
|
|
556
|
+
|
|
539
557
|
|
|
540
558
|
tshape_int = ShapeTypeInt()
|
|
541
559
|
|
|
@@ -605,7 +623,7 @@ if python_version < 0x300:
|
|
|
605
623
|
class ShapeTypeIntOrLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
|
|
606
624
|
__slots__ = ()
|
|
607
625
|
|
|
608
|
-
if isExperimental("
|
|
626
|
+
if isExperimental("optimize-dual-int"):
|
|
609
627
|
|
|
610
628
|
@staticmethod
|
|
611
629
|
def getCType():
|
|
@@ -903,11 +921,11 @@ class ShapeTypeList(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
|
|
|
903
921
|
|
|
904
922
|
# Need to consider value shape for this.
|
|
905
923
|
if right_shape in (tshape_list, tshape_tuple):
|
|
906
|
-
return
|
|
924
|
+
return operation_result_bool_element_based
|
|
907
925
|
|
|
908
926
|
if right_shape is tshape_xrange:
|
|
909
927
|
if python_version < 0x300:
|
|
910
|
-
return
|
|
928
|
+
return operation_result_bool_element_based
|
|
911
929
|
else:
|
|
912
930
|
# TODO: Actually unorderable, but this requires making a
|
|
913
931
|
# difference with "=="
|
|
@@ -1693,11 +1711,11 @@ class ShapeTypeXrange(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBa
|
|
|
1693
1711
|
if python_version < 0x300:
|
|
1694
1712
|
# Need to consider value shape for this.
|
|
1695
1713
|
if right_shape in (tshape_list, tshape_tuple):
|
|
1696
|
-
return
|
|
1714
|
+
return operation_result_bool_element_based
|
|
1697
1715
|
|
|
1698
1716
|
if right_shape is tshape_xrange:
|
|
1699
1717
|
# TODO: This is value escaping, but that doesn't really apply
|
|
1700
|
-
return
|
|
1718
|
+
return operation_result_bool_element_based
|
|
1701
1719
|
else:
|
|
1702
1720
|
# TODO: Actually unorderable, but this requires making a
|
|
1703
1721
|
# difference with "=="
|
|
@@ -1908,7 +1926,7 @@ operation_result_dict_noescape = tshape_dict, ControlFlowDescriptionNoEscape
|
|
|
1908
1926
|
operation_result_dict_valueerror = tshape_dict, ControlFlowDescriptionValueErrorNoEscape
|
|
1909
1927
|
|
|
1910
1928
|
|
|
1911
|
-
|
|
1929
|
+
operation_result_bool_element_based = (
|
|
1912
1930
|
tshape_bool,
|
|
1913
1931
|
ControlFlowDescriptionElementBasedEscape,
|
|
1914
1932
|
)
|
|
@@ -1965,7 +1983,6 @@ operation_result_unsupported_matmult = (
|
|
|
1965
1983
|
ControlFlowDescriptionMatmultUnsupported,
|
|
1966
1984
|
)
|
|
1967
1985
|
|
|
1968
|
-
|
|
1969
1986
|
# ZeroDivisionError can occur for some module and division operations, otherwise they
|
|
1970
1987
|
# are fixed type.
|
|
1971
1988
|
operation_result_zerodiv_int = tshape_int, ControlFlowDescriptionZeroDivisionNoEscape
|
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
from .ControlFlowDescriptions import (
|
|
9
|
+
ControlFlowDescriptionAddUnsupported,
|
|
9
10
|
ControlFlowDescriptionElementBasedEscape,
|
|
10
11
|
ControlFlowDescriptionNoEscape,
|
|
12
|
+
ControlFlowDescriptionSubUnsupported,
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
|
|
@@ -131,10 +133,19 @@ class ShapeNotNumberMixin(object):
|
|
|
131
133
|
def hasShapeSlotComplex():
|
|
132
134
|
return False
|
|
133
135
|
|
|
136
|
+
# TODO: Seems misplaced
|
|
134
137
|
@staticmethod
|
|
135
138
|
def hasShapeModule():
|
|
136
139
|
return False
|
|
137
140
|
|
|
141
|
+
@staticmethod
|
|
142
|
+
def getOperationUnaryAddShape():
|
|
143
|
+
return None, ControlFlowDescriptionAddUnsupported
|
|
144
|
+
|
|
145
|
+
@staticmethod
|
|
146
|
+
def getOperationUnarySubShape():
|
|
147
|
+
return None, ControlFlowDescriptionSubUnsupported
|
|
148
|
+
|
|
138
149
|
|
|
139
150
|
class ShapeNumberMixin(object):
|
|
140
151
|
"""Mixin that defines the number slots to be set."""
|
|
@@ -182,6 +193,12 @@ class ShapeNumberMixin(object):
|
|
|
182
193
|
def getOperationUnaryReprEscape():
|
|
183
194
|
return ControlFlowDescriptionNoEscape
|
|
184
195
|
|
|
196
|
+
def getOperationUnaryAddShape(self):
|
|
197
|
+
return self, ControlFlowDescriptionNoEscape
|
|
198
|
+
|
|
199
|
+
def getOperationUnarySubShape(self):
|
|
200
|
+
return self, ControlFlowDescriptionNoEscape
|
|
201
|
+
|
|
185
202
|
|
|
186
203
|
class ShapeIteratorMixin(ShapeNotContainerMixin):
|
|
187
204
|
# Mixins are required to define empty slots
|
|
@@ -8,7 +8,10 @@ from abc import abstractmethod
|
|
|
8
8
|
from nuitka.code_generation.c_types.CTypePyObjectPointers import (
|
|
9
9
|
CTypePyObjectPtr,
|
|
10
10
|
)
|
|
11
|
-
from nuitka.code_generation.Reports import
|
|
11
|
+
from nuitka.code_generation.Reports import (
|
|
12
|
+
onMissingOperation,
|
|
13
|
+
onMissingUnaryOperation,
|
|
14
|
+
)
|
|
12
15
|
from nuitka.utils.SlotMetaClasses import getMetaClassBase
|
|
13
16
|
|
|
14
17
|
from .ControlFlowDescriptions import ControlFlowDescriptionFullEscape
|
|
@@ -446,6 +449,16 @@ class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
|
|
|
446
449
|
|
|
447
450
|
return operation_result_unknown
|
|
448
451
|
|
|
452
|
+
def getOperationUnaryAddShape(self):
|
|
453
|
+
onMissingUnaryOperation("+", self)
|
|
454
|
+
|
|
455
|
+
return operation_result_unknown
|
|
456
|
+
|
|
457
|
+
def getOperationUnarySubShape(self):
|
|
458
|
+
onMissingUnaryOperation("-", self)
|
|
459
|
+
|
|
460
|
+
return operation_result_unknown
|
|
461
|
+
|
|
449
462
|
def getComparisonLtShape(self, right_shape):
|
|
450
463
|
onMissingOperation("Lt", self, right_shape)
|
|
451
464
|
|
|
@@ -543,6 +556,12 @@ class ShapeTypeUnknown(ShapeBase):
|
|
|
543
556
|
def getOperationBinaryMatMultShape(right_shape):
|
|
544
557
|
return operation_result_unknown
|
|
545
558
|
|
|
559
|
+
def getOperationUnaryAddShape(self):
|
|
560
|
+
return operation_result_unknown
|
|
561
|
+
|
|
562
|
+
def getOperationUnarySubShape(self):
|
|
563
|
+
return operation_result_unknown
|
|
564
|
+
|
|
546
565
|
@staticmethod
|
|
547
566
|
def getComparisonLtShape(right_shape):
|
|
548
567
|
return operation_result_unknown
|
|
@@ -650,6 +669,13 @@ class ShapeIterator(ShapeBase, ShapeIteratorMixin):
|
|
|
650
669
|
def getOperationUnaryReprEscape():
|
|
651
670
|
return ControlFlowDescriptionFullEscape
|
|
652
671
|
|
|
672
|
+
def getOperationUnaryAddShape(self):
|
|
673
|
+
# TODO: Move prepared values to separate module
|
|
674
|
+
return tshape_unknown, ControlFlowDescriptionFullEscape
|
|
675
|
+
|
|
676
|
+
def getOperationUnarySubShape(self):
|
|
677
|
+
return tshape_unknown, ControlFlowDescriptionFullEscape
|
|
678
|
+
|
|
653
679
|
|
|
654
680
|
tshape_iterator = ShapeIterator()
|
|
655
681
|
|
|
@@ -898,6 +924,22 @@ class ShapeLoopInitialAlternative(ShapeBase):
|
|
|
898
924
|
ControlFlowDescriptionFullEscape,
|
|
899
925
|
)
|
|
900
926
|
|
|
927
|
+
def getOperationUnaryAddShape(self):
|
|
928
|
+
return (
|
|
929
|
+
self._collectInitialShape(
|
|
930
|
+
operation=lambda left_shape: left_shape.getOperationUnaryAddShape()
|
|
931
|
+
),
|
|
932
|
+
ControlFlowDescriptionFullEscape,
|
|
933
|
+
)
|
|
934
|
+
|
|
935
|
+
def getOperationUnarySubShape(self):
|
|
936
|
+
return (
|
|
937
|
+
self._collectInitialShape(
|
|
938
|
+
operation=lambda left_shape: left_shape.getOperationUnarySubShape()
|
|
939
|
+
),
|
|
940
|
+
ControlFlowDescriptionFullEscape,
|
|
941
|
+
)
|
|
942
|
+
|
|
901
943
|
def getComparisonLtShape(self, right_shape):
|
|
902
944
|
if right_shape is tshape_unknown:
|
|
903
945
|
return operation_result_unknown
|
|
@@ -1162,6 +1204,16 @@ class ShapeLoopCompleteAlternative(ShapeBase):
|
|
|
1162
1204
|
)
|
|
1163
1205
|
)
|
|
1164
1206
|
|
|
1207
|
+
def getOperationUnaryAddShape(self):
|
|
1208
|
+
return self._collectShapeOperation(
|
|
1209
|
+
operation=lambda left_shape: left_shape.getOperationUnaryAddShape()
|
|
1210
|
+
)
|
|
1211
|
+
|
|
1212
|
+
def getOperationUnarySubShape(self):
|
|
1213
|
+
return self._collectShapeOperation(
|
|
1214
|
+
operation=lambda left_shape: left_shape.getOperationUnarySubShape()
|
|
1215
|
+
)
|
|
1216
|
+
|
|
1165
1217
|
# Special method to be called by other shapes encountering this type on
|
|
1166
1218
|
# the right side.
|
|
1167
1219
|
def getOperationBinaryAddLShape(self, left_shape):
|
|
@@ -23,6 +23,7 @@ from nuitka.plugins.Plugins import (
|
|
|
23
23
|
replaceTriggerModule,
|
|
24
24
|
)
|
|
25
25
|
from nuitka.Tracing import inclusion_logger
|
|
26
|
+
from nuitka.utils.FileOperations import getNormalizedPath
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
def demoteSourceCodeToBytecode(module_name, source_code, filename):
|
|
@@ -59,7 +60,7 @@ def demoteCompiledModuleToBytecode(module):
|
|
|
59
60
|
uncompiled_module = makeUncompiledPythonModule(
|
|
60
61
|
module_name=full_name,
|
|
61
62
|
reason=module.reason,
|
|
62
|
-
filename=filename,
|
|
63
|
+
filename=getNormalizedPath(filename),
|
|
63
64
|
bytecode=bytecode,
|
|
64
65
|
is_package=module.isCompiledPythonPackage(),
|
|
65
66
|
technical=full_name in detectEarlyImports(),
|
nuitka/plugins/PluginBase.py
CHANGED
|
@@ -172,7 +172,11 @@ def _getEvaluationContext():
|
|
|
172
172
|
# Iterating packages
|
|
173
173
|
"iterate_modules": _iterate_module_names,
|
|
174
174
|
# Locating package directories
|
|
175
|
-
"
|
|
175
|
+
"get_module_directory": _getModuleDirectory,
|
|
176
|
+
# Checking module presence
|
|
177
|
+
"has_module": _hasModule,
|
|
178
|
+
# Getting data files contents
|
|
179
|
+
"get_data": _getPackageData,
|
|
176
180
|
# Querying package properties
|
|
177
181
|
"has_builtin_module": isBuiltinModuleName,
|
|
178
182
|
# Architectures
|
|
@@ -326,6 +330,22 @@ def _getModuleDirectory(module_name):
|
|
|
326
330
|
return module_filename
|
|
327
331
|
|
|
328
332
|
|
|
333
|
+
def _hasModule(module_name):
|
|
334
|
+
from nuitka.importing.Importing import locateModule
|
|
335
|
+
|
|
336
|
+
_module_name, _module_filename, _module_kind, finding = locateModule(
|
|
337
|
+
module_name=ModuleName(module_name), parent_package=None, level=0
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
return finding != "not-found"
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def _getPackageData(package_name, resource):
|
|
344
|
+
from nuitka.utils.PackageResources import getPackageData
|
|
345
|
+
|
|
346
|
+
return getPackageData(package_name=ModuleName(package_name), resource=resource)
|
|
347
|
+
|
|
348
|
+
|
|
329
349
|
def _iterate_module_names(package_name):
|
|
330
350
|
package_name = ModuleName(package_name)
|
|
331
351
|
package_path = _getModuleDirectory(module_name=package_name)
|
|
@@ -1251,21 +1271,25 @@ Unwanted import of '%(unwanted)s' that %(problem)s '%(binding_name)s' encountere
|
|
|
1251
1271
|
setup_codes = setup_codes.splitlines()
|
|
1252
1272
|
|
|
1253
1273
|
if not setup_codes:
|
|
1254
|
-
setup_codes =
|
|
1274
|
+
setup_codes = ("pass",)
|
|
1255
1275
|
|
|
1256
1276
|
cmd = r"""\
|
|
1257
1277
|
from __future__ import print_function
|
|
1258
1278
|
from __future__ import absolute_import
|
|
1279
|
+
import sys
|
|
1259
1280
|
|
|
1260
1281
|
try:
|
|
1261
1282
|
%(setup_codes)s
|
|
1262
1283
|
except ImportError:
|
|
1263
|
-
import sys
|
|
1264
1284
|
sys.exit(38)
|
|
1285
|
+
try:
|
|
1265
1286
|
%(query_codes)s
|
|
1287
|
+
except Exception as e:
|
|
1288
|
+
sys.stderr.write("\n%%s" %% repr(e))
|
|
1289
|
+
sys.exit(39)
|
|
1266
1290
|
""" % {
|
|
1267
1291
|
"setup_codes": "\n".join(" %s" % line for line in setup_codes),
|
|
1268
|
-
"query_codes": "\n".join(query_codes),
|
|
1292
|
+
"query_codes": "\n".join(" %s" % line for line in query_codes),
|
|
1269
1293
|
}
|
|
1270
1294
|
|
|
1271
1295
|
if shallShowExecutedCommands():
|
|
@@ -1283,6 +1307,16 @@ except ImportError:
|
|
|
1283
1307
|
if Options.is_debug:
|
|
1284
1308
|
self.info(cmd, keep_format=True)
|
|
1285
1309
|
|
|
1310
|
+
if e.returncode == 39:
|
|
1311
|
+
# TODO: Recognize the ModuleNotFoundError or ImportError exceptions
|
|
1312
|
+
# and output the missing module.
|
|
1313
|
+
self.warning(
|
|
1314
|
+
"Exception during compile time command execution: %s"
|
|
1315
|
+
% e.stderr.splitlines()[-1]
|
|
1316
|
+
)
|
|
1317
|
+
|
|
1318
|
+
return None
|
|
1319
|
+
|
|
1286
1320
|
raise
|
|
1287
1321
|
|
|
1288
1322
|
if str is not bytes: # We want to work with strings, that's hopefully OK.
|
|
@@ -1469,7 +1503,7 @@ except ImportError:
|
|
|
1469
1503
|
|
|
1470
1504
|
if info is None:
|
|
1471
1505
|
self.sysexit(
|
|
1472
|
-
"Error, failed to evaluate variables for %s." % full_name
|
|
1506
|
+
"Error, failed to evaluate variables for '%s'." % full_name
|
|
1473
1507
|
)
|
|
1474
1508
|
|
|
1475
1509
|
variables.update(info.asDict())
|
|
@@ -1541,38 +1575,46 @@ except ImportError:
|
|
|
1541
1575
|
raise
|
|
1542
1576
|
|
|
1543
1577
|
self.sysexit(
|
|
1544
|
-
"Error, failed to evaluate expression %r in this context, exception was '%
|
|
1578
|
+
"Error, failed to evaluate expression %r in this context, exception was '%r'."
|
|
1545
1579
|
% (expression, e)
|
|
1546
1580
|
)
|
|
1547
1581
|
|
|
1548
1582
|
if type(result) not in (str, unicode):
|
|
1549
1583
|
if single_value:
|
|
1550
|
-
self.
|
|
1551
|
-
|
|
1552
|
-
Error, expression '%s' for module '%s' did not evaluate to 'str' result."""
|
|
1553
|
-
% (expression, full_name)
|
|
1584
|
+
self._checkStrResult(
|
|
1585
|
+
value=result, expression=expression, full_name=full_name
|
|
1554
1586
|
)
|
|
1555
1587
|
else:
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
Error, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result."""
|
|
1560
|
-
% (expression, full_name)
|
|
1561
|
-
)
|
|
1588
|
+
self._checkSequenceResult(
|
|
1589
|
+
value=result, expression=expression, full_name=full_name
|
|
1590
|
+
)
|
|
1562
1591
|
|
|
1563
1592
|
for v in result:
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
Error, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result."""
|
|
1568
|
-
% (expression, full_name)
|
|
1569
|
-
)
|
|
1593
|
+
self._checkStrResult(
|
|
1594
|
+
value=v, expression=expression, full_name=full_name
|
|
1595
|
+
)
|
|
1570
1596
|
|
|
1571
1597
|
# Make it immutable in case it's a list.
|
|
1572
1598
|
result = tuple(result)
|
|
1573
1599
|
|
|
1574
1600
|
return result
|
|
1575
1601
|
|
|
1602
|
+
def _checkStrResult(self, value, expression, full_name):
|
|
1603
|
+
if type(value) not in (str, unicode):
|
|
1604
|
+
self.sysexit(
|
|
1605
|
+
"""\
|
|
1606
|
+
Error, expression '%s' for module '%s' did not evaluate to 'str', 'tuple[str]' or 'list[str]' result but '%s'"""
|
|
1607
|
+
% (expression, full_name, type(value))
|
|
1608
|
+
)
|
|
1609
|
+
|
|
1610
|
+
def _checkSequenceResult(self, value, expression, full_name):
|
|
1611
|
+
if type(value) not in (tuple, list):
|
|
1612
|
+
self.sysexit(
|
|
1613
|
+
"""\
|
|
1614
|
+
Error, expression '%s' for module '%s' did not evaluate to 'tuple[str]' or 'list[str]' result."""
|
|
1615
|
+
% (expression, full_name)
|
|
1616
|
+
)
|
|
1617
|
+
|
|
1576
1618
|
def evaluateCondition(self, full_name, condition):
|
|
1577
1619
|
# Note: Caching makes no sense yet, this should all be very fast and
|
|
1578
1620
|
# cache themselves. TODO: Allow plugins to contribute their own control
|
nuitka/plugins/Plugins.py
CHANGED
|
@@ -33,6 +33,7 @@ from nuitka.PythonVersions import python_version
|
|
|
33
33
|
from nuitka.Tracing import plugins_logger, printLine
|
|
34
34
|
from nuitka.utils.FileOperations import (
|
|
35
35
|
getDllBasename,
|
|
36
|
+
getNormalizedPath,
|
|
36
37
|
makePath,
|
|
37
38
|
putTextFileContents,
|
|
38
39
|
)
|
|
@@ -784,9 +785,11 @@ class Plugins(object):
|
|
|
784
785
|
|
|
785
786
|
try:
|
|
786
787
|
trigger_module = buildModule(
|
|
787
|
-
module_filename=
|
|
788
|
-
os.path.
|
|
789
|
-
|
|
788
|
+
module_filename=getNormalizedPath(
|
|
789
|
+
os.path.join(
|
|
790
|
+
os.path.dirname(module.getCompileTimeFilename()),
|
|
791
|
+
module_name.asPath() + ".py",
|
|
792
|
+
)
|
|
790
793
|
),
|
|
791
794
|
module_name=module_name,
|
|
792
795
|
reason="trigger",
|