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
|
@@ -471,7 +471,14 @@ def getBuiltinCallViaSpecCode(spec, to_name, called_name, expression, emit, cont
|
|
|
471
471
|
PyObject *args[] = {%(arg_value_names)s};
|
|
472
472
|
char const *arg_names[] = {%(arg_names)s};
|
|
473
473
|
|
|
474
|
-
%(to_name)s = CALL_BUILTIN_KW_ARGS(
|
|
474
|
+
%(to_name)s = CALL_BUILTIN_KW_ARGS(
|
|
475
|
+
tstate,
|
|
476
|
+
%(called_name)s,
|
|
477
|
+
args,
|
|
478
|
+
arg_names,
|
|
479
|
+
sizeof(args) / sizeof(PyObject *),
|
|
480
|
+
%(kw_only_count)d
|
|
481
|
+
);
|
|
475
482
|
}
|
|
476
483
|
"""
|
|
477
484
|
% {
|
|
@@ -484,6 +491,7 @@ def getBuiltinCallViaSpecCode(spec, to_name, called_name, expression, emit, cont
|
|
|
484
491
|
(str(arg_value_name) if arg_value_name else "NULL")
|
|
485
492
|
for arg_value_name in arg_value_names
|
|
486
493
|
),
|
|
494
|
+
"kw_only_count": spec.getKwOnlyParameterCount(),
|
|
487
495
|
}
|
|
488
496
|
)
|
|
489
497
|
|
|
@@ -193,28 +193,28 @@ def _getCallCodeKwSplitFromConstant(
|
|
|
193
193
|
kw_names = tuple(item[0] for item in kw_items)
|
|
194
194
|
|
|
195
195
|
if isMutable(values):
|
|
196
|
-
|
|
196
|
+
args_kw_split_name = context.allocateTempName("call_args_kw_split")
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
to_name=
|
|
198
|
+
args_kw_split_name.getCType().emitAssignmentCodeFromConstant(
|
|
199
|
+
to_name=args_kw_split_name,
|
|
200
200
|
constant=values,
|
|
201
201
|
may_escape=True,
|
|
202
202
|
emit=emit,
|
|
203
203
|
context=context,
|
|
204
204
|
)
|
|
205
|
-
split_name =
|
|
205
|
+
split_name = args_kw_split_name
|
|
206
206
|
else:
|
|
207
|
-
|
|
207
|
+
args_kw_split_name = context.getConstantCode(values)
|
|
208
208
|
split_name = None
|
|
209
209
|
|
|
210
210
|
emitLineNumberUpdateCode(expression, emit, context)
|
|
211
211
|
|
|
212
212
|
emit(
|
|
213
|
-
"""%s =
|
|
213
|
+
"""%s = CALL_FUNCTION_WITH_NO_ARGS_KW_SPLIT(tstate, %s, &PyTuple_GET_ITEM(%s, 0), %s);"""
|
|
214
214
|
% (
|
|
215
215
|
to_name,
|
|
216
216
|
called_name,
|
|
217
|
-
|
|
217
|
+
args_kw_split_name,
|
|
218
218
|
context.getConstantCode(kw_names),
|
|
219
219
|
)
|
|
220
220
|
)
|
|
@@ -238,7 +238,7 @@ def getCallCodeKwSplit(
|
|
|
238
238
|
{
|
|
239
239
|
PyObject *kw_values[%(kw_size)d] = {%(kw_value_names)s};
|
|
240
240
|
|
|
241
|
-
%(to_name)s =
|
|
241
|
+
%(to_name)s = CALL_FUNCTION_WITH_NO_ARGS_KW_SPLIT(tstate, %(called_name)s, kw_values, %(kw_names)s);
|
|
242
242
|
}
|
|
243
243
|
"""
|
|
244
244
|
% {
|
|
@@ -347,7 +347,7 @@ def _generateCallCodeKwDict(
|
|
|
347
347
|
|
|
348
348
|
emit(
|
|
349
349
|
"""\
|
|
350
|
-
%(to_name)s =
|
|
350
|
+
%(to_name)s = CALL_FUNCTION_WITH_KW_ARGS(tstate, %(called_name)s, %(kw_dict_name)s);
|
|
351
351
|
"""
|
|
352
352
|
% {
|
|
353
353
|
"to_name": to_name,
|
|
@@ -744,7 +744,7 @@ def _getCallCodeFromTuple(to_name, called_name, expression, args_value, emit, co
|
|
|
744
744
|
# recreated for cases, e.g. when calling C functions, so this is a good way of
|
|
745
745
|
# having them.
|
|
746
746
|
if isMutable(args_value):
|
|
747
|
-
arg_tuple_name = context.allocateTempName("
|
|
747
|
+
arg_tuple_name = context.allocateTempName("call_args_tuple")
|
|
748
748
|
|
|
749
749
|
arg_tuple_name.getCType().emitAssignmentCodeFromConstant(
|
|
750
750
|
to_name=arg_tuple_name,
|
|
@@ -762,7 +762,7 @@ def _getCallCodeFromTuple(to_name, called_name, expression, args_value, emit, co
|
|
|
762
762
|
|
|
763
763
|
emit(
|
|
764
764
|
"""\
|
|
765
|
-
%s =
|
|
765
|
+
%s = CALL_FUNCTION_WITH_POS_ARGS%d(tstate, %s, %s);
|
|
766
766
|
"""
|
|
767
767
|
% (to_name, arg_size, called_name, arg_tuple_name)
|
|
768
768
|
)
|
|
@@ -790,7 +790,7 @@ def _getInstanceCallCodePosArgs(
|
|
|
790
790
|
emitLineNumberUpdateCode(expression, emit, context)
|
|
791
791
|
|
|
792
792
|
emit(
|
|
793
|
-
"%s =
|
|
793
|
+
"%s = CALL_METHOD_WITH_POS_ARGS(%s, %s, %s);"
|
|
794
794
|
% (to_name, called_name, called_attribute_name, args_name)
|
|
795
795
|
)
|
|
796
796
|
|
|
@@ -809,7 +809,7 @@ def _getCallCodePosArgs(to_name, called_name, expression, args_name, emit, conte
|
|
|
809
809
|
emitLineNumberUpdateCode(expression, emit, context)
|
|
810
810
|
|
|
811
811
|
emit(
|
|
812
|
-
"%s =
|
|
812
|
+
"%s = CALL_FUNCTION_WITH_POS_ARGS(tstate, %s, %s);"
|
|
813
813
|
% (to_name, called_name, args_name)
|
|
814
814
|
)
|
|
815
815
|
|
|
@@ -855,7 +855,7 @@ def _getCallCodePosConstKeywordVariableArgs(
|
|
|
855
855
|
quick_mixed_calls_used.add((args_count, True, True))
|
|
856
856
|
|
|
857
857
|
if isMutable(args):
|
|
858
|
-
args_value_name = context.allocateTempName("
|
|
858
|
+
args_value_name = context.allocateTempName("call_pos_args_values")
|
|
859
859
|
|
|
860
860
|
args_value_name.getCType().emitAssignmentCodeFromConstant(
|
|
861
861
|
to_name=args_value_name,
|
|
@@ -875,7 +875,7 @@ def _getCallCodePosConstKeywordVariableArgs(
|
|
|
875
875
|
"""\
|
|
876
876
|
{
|
|
877
877
|
PyObject *kw_values[%(kw_size)d] = {%(kw_values)s};
|
|
878
|
-
%(to_name)s =
|
|
878
|
+
%(to_name)s = CALL_FUNCTION_WITH_POS_ARGS%(args_count)d_KW_SPLIT(\
|
|
879
879
|
tstate, %(called_name)s, %(pos_args)s, kw_values, %(kw_names)s);
|
|
880
880
|
}
|
|
881
881
|
"""
|
|
@@ -962,7 +962,7 @@ def getCallCodePosVariableKeywordVariableArgs(
|
|
|
962
962
|
{
|
|
963
963
|
PyObject *args[] = {%(call_arg_names)s};
|
|
964
964
|
PyObject *kw_values[%(kw_size)d] = {%(kw_value_names)s};
|
|
965
|
-
%(to_name)s = CALL_FUNCTION_WITH_ARGS%(args_count)
|
|
965
|
+
%(to_name)s = CALL_FUNCTION_WITH_ARGS%(args_count)d_KW_SPLIT(tstate, %(called_name)s, args, kw_values, %(kw_names)s);
|
|
966
966
|
}
|
|
967
967
|
"""
|
|
968
968
|
% {
|
|
@@ -275,6 +275,7 @@ from .PackageResourceCodes import (
|
|
|
275
275
|
generateImportlibResourcesReadBinaryCallCode,
|
|
276
276
|
generateImportlibResourcesReadTextCallCode,
|
|
277
277
|
generateOsListdirCallCode,
|
|
278
|
+
generateOsLstatCallCode,
|
|
278
279
|
generateOsPathAbspathCallCode,
|
|
279
280
|
generateOsPathBasenameCallCode,
|
|
280
281
|
generateOsPathDirnameCallCode,
|
|
@@ -283,6 +284,7 @@ from .PackageResourceCodes import (
|
|
|
283
284
|
generateOsPathIsdirCallCode,
|
|
284
285
|
generateOsPathIsfileCallCode,
|
|
285
286
|
generateOsPathNormpathCallCode,
|
|
287
|
+
generateOsStatCallCode,
|
|
286
288
|
generateOsUnameCallCode,
|
|
287
289
|
generatePkglibGetDataCallCode,
|
|
288
290
|
generatePkgResourcesDistributionValueCode,
|
|
@@ -345,7 +347,11 @@ from .SubscriptCodes import (
|
|
|
345
347
|
from .TensorflowCodes import generateTensorflowFunctionCallCode
|
|
346
348
|
from .TryCodes import generateTryCode
|
|
347
349
|
from .TupleCodes import generateBuiltinTupleCode, generateTupleCreationCode
|
|
348
|
-
from .TypeAliasCodes import
|
|
350
|
+
from .TypeAliasCodes import (
|
|
351
|
+
generateTypeAliasCode,
|
|
352
|
+
generateTypeGenericCode,
|
|
353
|
+
generateTypeVarCode,
|
|
354
|
+
)
|
|
349
355
|
from .VariableCodes import (
|
|
350
356
|
generateAssignmentVariableCode,
|
|
351
357
|
generateDelVariableCode,
|
|
@@ -673,6 +679,7 @@ addExpressionDispatchDict(
|
|
|
673
679
|
"EXPRESSION_BUILTIN_MAKE_EXCEPTION": generateBuiltinMakeExceptionCode,
|
|
674
680
|
"EXPRESSION_BUILTIN_MAKE_EXCEPTION_IMPORT_ERROR": generateBuiltinMakeExceptionCode,
|
|
675
681
|
"EXPRESSION_BUILTIN_MAKE_EXCEPTION_MODULE_NOT_FOUND_ERROR": generateBuiltinMakeExceptionCode,
|
|
682
|
+
"EXPRESSION_BUILTIN_MAKE_EXCEPTION_ATTRIBUTE_ERROR": generateBuiltinMakeExceptionCode,
|
|
676
683
|
"EXPRESSION_BUILTIN_REF": generateBuiltinRefCode,
|
|
677
684
|
"EXPRESSION_BUILTIN_WITH_CONTEXT_REF": generateBuiltinRefCode,
|
|
678
685
|
"EXPRESSION_BUILTIN_EXCEPTION_REF": generateExceptionRefCode,
|
|
@@ -906,6 +913,8 @@ addExpressionDispatchDict(
|
|
|
906
913
|
"EXPRESSION_SYS_EXIT_REF": generateImportModuleNameHardCode,
|
|
907
914
|
"EXPRESSION_OS_UNAME_REF": generateImportModuleNameHardCode,
|
|
908
915
|
"EXPRESSION_OS_LISTDIR_REF": generateImportModuleNameHardCode,
|
|
916
|
+
"EXPRESSION_OS_STAT_REF": generateImportModuleNameHardCode,
|
|
917
|
+
"EXPRESSION_OS_LSTAT_REF": generateImportModuleNameHardCode,
|
|
909
918
|
"EXPRESSION_OS_PATH_EXISTS_REF": generateImportModuleNameHardCode,
|
|
910
919
|
"EXPRESSION_OS_PATH_ISFILE_REF": generateImportModuleNameHardCode,
|
|
911
920
|
"EXPRESSION_OS_PATH_ISDIR_REF": generateImportModuleNameHardCode,
|
|
@@ -945,7 +954,11 @@ addExpressionDispatchDict(
|
|
|
945
954
|
"EXPRESSION_OS_PATH_NORMPATH_CALL": generateOsPathNormpathCallCode,
|
|
946
955
|
"EXPRESSION_OS_PATH_ISABS_CALL": generateOsPathIsabsCallCode,
|
|
947
956
|
"EXPRESSION_OS_LISTDIR_CALL": generateOsListdirCallCode,
|
|
957
|
+
"EXPRESSION_OS_STAT_CALL": generateOsStatCallCode,
|
|
958
|
+
"EXPRESSION_OS_LSTAT_CALL": generateOsLstatCallCode,
|
|
948
959
|
"EXPRESSION_TYPE_ALIAS": generateTypeAliasCode,
|
|
960
|
+
"EXPRESSION_TYPE_VARIABLE": generateTypeVarCode,
|
|
961
|
+
"EXPRESSION_TYPE_MAKE_GENERIC": generateTypeGenericCode,
|
|
949
962
|
"EXPRESSION_STR_OPERATION_FORMAT": generateStrFormatMethodCode,
|
|
950
963
|
# TODO: Should have all of these generically or not. This one is required for now.
|
|
951
964
|
"EXPRESSION_DICT_OPERATION_FROMKEYS_REF": generateDictOperationFromkeysRefCode,
|
|
@@ -1028,7 +1041,6 @@ setStatementDispatchDict(
|
|
|
1028
1041
|
"STATEMENT_LOOP_BREAK": generateLoopBreakCode,
|
|
1029
1042
|
"STATEMENT_LOOP_CONTINUE": generateLoopContinueCode,
|
|
1030
1043
|
"STATEMENT_RAISE_EXCEPTION": generateRaiseCode,
|
|
1031
|
-
"STATEMENT_RAISE_EXCEPTION_IMPLICIT": generateRaiseCode,
|
|
1032
1044
|
"STATEMENT_RERAISE_EXCEPTION": generateReraiseCode,
|
|
1033
1045
|
"STATEMENT_SPECIAL_UNPACK_CHECK": generateUnpackCheckCode,
|
|
1034
1046
|
"STATEMENT_SPECIAL_UNPACK_CHECK_FROM_ITERATED": generateUnpackCheckFromIteratedCode,
|
|
@@ -50,7 +50,7 @@ def selectCodeHelper(
|
|
|
50
50
|
if helper_function not in specialized_helpers_set:
|
|
51
51
|
if (
|
|
52
52
|
report_missing
|
|
53
|
-
and Options.
|
|
53
|
+
and Options.report_missing_code_helpers
|
|
54
54
|
and (
|
|
55
55
|
not non_specialized_helpers_set
|
|
56
56
|
or helper_function not in non_specialized_helpers_set
|
|
@@ -180,7 +180,10 @@ def generateStatementCode(statement, emit, context):
|
|
|
180
180
|
)
|
|
181
181
|
|
|
182
182
|
# Complain if any temporary was not dealt with yet.
|
|
183
|
-
assert not context.getCleanupTempNames(),
|
|
183
|
+
assert not context.getCleanupTempNames(), (
|
|
184
|
+
statement.asXmlText(),
|
|
185
|
+
context.getCleanupTempNames(),
|
|
186
|
+
)
|
|
184
187
|
except Exception:
|
|
185
188
|
printError(
|
|
186
189
|
"Problem with %r at %s"
|
|
@@ -23,7 +23,7 @@ def getCodeObjectsDeclCode(context):
|
|
|
23
23
|
|
|
24
24
|
if context.getOwner().getFullName() == "__main__":
|
|
25
25
|
statements.append('/* For use in "MainProgram.c". */')
|
|
26
|
-
statements.append("PyCodeObject *
|
|
26
|
+
statements.append("PyCodeObject *code_objects_main = NULL;")
|
|
27
27
|
|
|
28
28
|
return statements
|
|
29
29
|
|
|
@@ -127,7 +127,7 @@ def getCodeObjectsInitCode(context):
|
|
|
127
127
|
|
|
128
128
|
if context.getOwner().getFullName() == "__main__":
|
|
129
129
|
if code_object_key[1] == "<module>":
|
|
130
|
-
statements.append("
|
|
130
|
+
statements.append("code_objects_main = %s;" % code_identifier)
|
|
131
131
|
|
|
132
132
|
return statements
|
|
133
133
|
|
|
@@ -73,7 +73,12 @@ def getRichComparisonCode(
|
|
|
73
73
|
right_shape,
|
|
74
74
|
left_c_type,
|
|
75
75
|
right_c_type,
|
|
76
|
-
) = decideExpressionCTypes(
|
|
76
|
+
) = decideExpressionCTypes(
|
|
77
|
+
left=left,
|
|
78
|
+
right=right,
|
|
79
|
+
may_swap_arguments="always",
|
|
80
|
+
context=context,
|
|
81
|
+
)
|
|
77
82
|
|
|
78
83
|
if unknown_types:
|
|
79
84
|
assert not needs_argument_swap
|
|
@@ -182,9 +187,13 @@ def getRichComparisonCode(
|
|
|
182
187
|
if needs_argument_swap:
|
|
183
188
|
arg1_name = right_name
|
|
184
189
|
arg2_name = left_name
|
|
190
|
+
arg1_c_type = right_c_type
|
|
191
|
+
arg2_c_type = left_c_type
|
|
185
192
|
else:
|
|
186
193
|
arg1_name = left_name
|
|
187
194
|
arg2_name = right_name
|
|
195
|
+
arg1_c_type = left_c_type
|
|
196
|
+
arg2_c_type = right_c_type
|
|
188
197
|
|
|
189
198
|
# May need to convert return value.
|
|
190
199
|
if helper_type is not target_type:
|
|
@@ -197,11 +206,13 @@ def getRichComparisonCode(
|
|
|
197
206
|
value_name = to_name
|
|
198
207
|
|
|
199
208
|
emit(
|
|
200
|
-
"%s = %s(%s, %s);"
|
|
209
|
+
"%s = %s(%s%s, %s%s);"
|
|
201
210
|
% (
|
|
202
211
|
value_name,
|
|
203
212
|
helper_function,
|
|
213
|
+
"&" if arg1_c_type.isDualType() else "",
|
|
204
214
|
arg1_name,
|
|
215
|
+
"&" if arg2_c_type.isDualType() else "",
|
|
205
216
|
arg2_name,
|
|
206
217
|
)
|
|
207
218
|
)
|
|
@@ -44,6 +44,10 @@ def _makeTypeOps(type_name, may_raise_same_type, shortcut=False):
|
|
|
44
44
|
if result_part == "CBOOL":
|
|
45
45
|
continue
|
|
46
46
|
|
|
47
|
+
# TODO: We want those as well, but we don't need them immediately.
|
|
48
|
+
if type_name in ("NILONG",):
|
|
49
|
+
continue
|
|
50
|
+
|
|
47
51
|
yield "RICH_COMPARE_%s_%s_OBJECT_%s" % (comparator, result_part, type_name)
|
|
48
52
|
yield "RICH_COMPARE_%s_%s_%s_OBJECT" % (comparator, result_part, type_name)
|
|
49
53
|
|
|
@@ -65,7 +69,7 @@ def _makeTypeOps(type_name, may_raise_same_type, shortcut=False):
|
|
|
65
69
|
)
|
|
66
70
|
|
|
67
71
|
|
|
68
|
-
def _makeFriendOps(type_name1, type_name2, may_raise):
|
|
72
|
+
def _makeFriendOps(type_name1, type_name2, may_raise, shortcut):
|
|
69
73
|
assert type_name1 != type_name2
|
|
70
74
|
|
|
71
75
|
for result_part in "OBJECT", "CBOOL", "NBOOL":
|
|
@@ -73,7 +77,11 @@ def _makeFriendOps(type_name1, type_name2, may_raise):
|
|
|
73
77
|
if result_part == "NBOOL":
|
|
74
78
|
continue
|
|
75
79
|
|
|
76
|
-
for comparator in
|
|
80
|
+
for comparator in (
|
|
81
|
+
rich_comparison_codes.values()
|
|
82
|
+
if not shortcut
|
|
83
|
+
else rich_comparison_subset_codes.values()
|
|
84
|
+
):
|
|
77
85
|
yield "RICH_COMPARE_%s_%s_%s_%s" % (
|
|
78
86
|
comparator,
|
|
79
87
|
result_part,
|
|
@@ -92,15 +100,22 @@ specialized_cmp_helpers_set = buildOrderedSet(
|
|
|
92
100
|
_makeTypeOps("INT", may_raise_same_type=False, shortcut=True),
|
|
93
101
|
_makeTypeOps("LONG", may_raise_same_type=False, shortcut=True),
|
|
94
102
|
_makeTypeOps("FLOAT", may_raise_same_type=False, shortcut=True),
|
|
103
|
+
# Dual types
|
|
104
|
+
_makeTypeOps("NILONG", may_raise_same_type=False, shortcut=True),
|
|
95
105
|
# TODO: What would shortcut mean, how do tuples compare their elements then?
|
|
96
|
-
_makeTypeOps("TUPLE", may_raise_same_type=True),
|
|
97
|
-
_makeTypeOps("LIST", may_raise_same_type=True),
|
|
106
|
+
_makeTypeOps("TUPLE", may_raise_same_type=True, shortcut=False),
|
|
107
|
+
_makeTypeOps("LIST", may_raise_same_type=True, shortcut=False),
|
|
98
108
|
# Mixed Python types:
|
|
99
|
-
|
|
109
|
+
# TODO: Absolutely possible to shortcut, why aren't we doing it?
|
|
110
|
+
_makeFriendOps("LONG", "INT", may_raise=False, shortcut=False),
|
|
100
111
|
# Partial Python with C types
|
|
101
|
-
|
|
102
|
-
_makeFriendOps("
|
|
103
|
-
_makeFriendOps("
|
|
112
|
+
# TODO: Absolutely possible to shortcut, why aren't we doing it?
|
|
113
|
+
_makeFriendOps("INT", "CLONG", may_raise=False, shortcut=False),
|
|
114
|
+
_makeFriendOps("LONG", "DIGIT", may_raise=False, shortcut=False),
|
|
115
|
+
_makeFriendOps("FLOAT", "CFLOAT", may_raise=False, shortcut=False),
|
|
116
|
+
# Partial dual types with C types, cannot shortcut as reverse argument versions are used.
|
|
117
|
+
_makeFriendOps("NILONG", "CLONG", may_raise=False, shortcut=False),
|
|
118
|
+
_makeFriendOps("NILONG", "DIGIT", may_raise=False, shortcut=False),
|
|
104
119
|
# TODO: Add "CLONG_CLONG" type ops once we use that for local variables too.
|
|
105
120
|
)
|
|
106
121
|
|
|
@@ -49,7 +49,7 @@ class TempMixin(object):
|
|
|
49
49
|
self.false_target = None
|
|
50
50
|
|
|
51
51
|
self.keeper_variable_count = 0
|
|
52
|
-
self.exception_keepers = (None, None
|
|
52
|
+
self.exception_keepers = (None, None)
|
|
53
53
|
|
|
54
54
|
self.preserver_variable_declaration = {}
|
|
55
55
|
|
|
@@ -65,6 +65,9 @@ class TempMixin(object):
|
|
|
65
65
|
# We might be hard coding too many details for special temps
|
|
66
66
|
# here, pylint: disable=too-many-branches
|
|
67
67
|
|
|
68
|
+
# TODO: This should be achieved.
|
|
69
|
+
# assert not base_name.startswith("tmp_"), base_name
|
|
70
|
+
|
|
68
71
|
if unique:
|
|
69
72
|
number = None
|
|
70
73
|
else:
|
|
@@ -169,24 +172,14 @@ class TempMixin(object):
|
|
|
169
172
|
debug = Options.is_debug and python_version >= 0x300
|
|
170
173
|
|
|
171
174
|
if debug:
|
|
172
|
-
keeper_obj_init = "
|
|
175
|
+
keeper_obj_init = "Empty_Nuitka_ExceptionPreservationItem"
|
|
173
176
|
else:
|
|
174
177
|
keeper_obj_init = None
|
|
175
178
|
|
|
176
179
|
return (
|
|
177
180
|
self.variable_storage.addVariableDeclarationTop(
|
|
178
|
-
"
|
|
179
|
-
"
|
|
180
|
-
keeper_obj_init,
|
|
181
|
-
),
|
|
182
|
-
self.variable_storage.addVariableDeclarationTop(
|
|
183
|
-
"PyObject *",
|
|
184
|
-
"exception_keeper_value_%d" % self.keeper_variable_count,
|
|
185
|
-
keeper_obj_init,
|
|
186
|
-
),
|
|
187
|
-
self.variable_storage.addVariableDeclarationTop(
|
|
188
|
-
"PyTracebackObject *",
|
|
189
|
-
"exception_keeper_tb_%d" % self.keeper_variable_count,
|
|
181
|
+
"struct Nuitka_ExceptionPreservationItem",
|
|
182
|
+
"exception_keeper_name_%d" % self.keeper_variable_count,
|
|
190
183
|
keeper_obj_init,
|
|
191
184
|
),
|
|
192
185
|
self.variable_storage.addVariableDeclarationTop(
|
|
@@ -202,6 +195,7 @@ class TempMixin(object):
|
|
|
202
195
|
def setExceptionKeeperVariables(self, keeper_vars):
|
|
203
196
|
result = self.exception_keepers
|
|
204
197
|
self.exception_keepers = tuple(keeper_vars)
|
|
198
|
+
assert len(self.exception_keepers) == 2
|
|
205
199
|
return result
|
|
206
200
|
|
|
207
201
|
def addExceptionPreserverVariables(self, preserver_id):
|
|
@@ -321,7 +315,7 @@ class CodeObjectsMixin(object):
|
|
|
321
315
|
)
|
|
322
316
|
|
|
323
317
|
if key not in self.code_objects:
|
|
324
|
-
self.code_objects[key] = "
|
|
318
|
+
self.code_objects[key] = "code_objects_%s" % self._calcHash(key)
|
|
325
319
|
|
|
326
320
|
return self.code_objects[key]
|
|
327
321
|
|
|
@@ -570,6 +564,9 @@ class PythonChildContextBase(PythonContextBase):
|
|
|
570
564
|
def addFunctionCreationInfo(self, creation_info):
|
|
571
565
|
return self.parent.addFunctionCreationInfo(creation_info)
|
|
572
566
|
|
|
567
|
+
def setModuleVariableAccessorCaching(self, variable_name, caching):
|
|
568
|
+
self.parent.setModuleVariableAccessorCaching(variable_name, caching)
|
|
569
|
+
|
|
573
570
|
|
|
574
571
|
class FrameDeclarationsMixin(object):
|
|
575
572
|
# Mixins are not allowed to specify slots, pylint: disable=assigning-non-slot
|
|
@@ -606,7 +603,7 @@ class FrameDeclarationsMixin(object):
|
|
|
606
603
|
)
|
|
607
604
|
|
|
608
605
|
else:
|
|
609
|
-
frame_handle = code_identifier.replace("
|
|
606
|
+
frame_handle = code_identifier.replace("code_objects_", "frame_")
|
|
610
607
|
|
|
611
608
|
if self.frames_used > 1:
|
|
612
609
|
frame_handle += "_%d" % self.frames_used
|
|
@@ -772,6 +769,7 @@ class PythonModuleContext(
|
|
|
772
769
|
"function_table_entries",
|
|
773
770
|
"constant_accessor",
|
|
774
771
|
"module_init_codes",
|
|
772
|
+
"module_variable_caching",
|
|
775
773
|
# FrameDeclarationsMixin
|
|
776
774
|
"frame_variables_stack",
|
|
777
775
|
"frame_type_descriptions",
|
|
@@ -830,6 +828,8 @@ class PythonModuleContext(
|
|
|
830
828
|
|
|
831
829
|
self.module_init_codes = []
|
|
832
830
|
|
|
831
|
+
self.module_variable_caching = {}
|
|
832
|
+
|
|
833
833
|
def __repr__(self):
|
|
834
834
|
return "<PythonModuleContext instance for module %s>" % self.name
|
|
835
835
|
|
|
@@ -839,6 +839,18 @@ class PythonModuleContext(
|
|
|
839
839
|
def getEntryPoint(self):
|
|
840
840
|
return self.module
|
|
841
841
|
|
|
842
|
+
def setModuleVariableAccessorCaching(self, variable_name, caching):
|
|
843
|
+
if caching:
|
|
844
|
+
self.module_variable_caching[variable_name] = True
|
|
845
|
+
elif variable_name not in self.module_variable_caching:
|
|
846
|
+
self.module_variable_caching[variable_name] = False
|
|
847
|
+
|
|
848
|
+
def isModuleVariableAccessorCaching(self, variable_name):
|
|
849
|
+
return self.module_variable_caching.get(variable_name, False)
|
|
850
|
+
|
|
851
|
+
def getModuleVariableAccessors(self):
|
|
852
|
+
return self.module_variable_caching
|
|
853
|
+
|
|
842
854
|
def isCompiledPythonModule(self):
|
|
843
855
|
return True
|
|
844
856
|
|
|
@@ -87,17 +87,13 @@ def getCoroutineObjectCode(
|
|
|
87
87
|
|
|
88
88
|
if needs_exception_exit:
|
|
89
89
|
(
|
|
90
|
-
|
|
91
|
-
exception_value,
|
|
92
|
-
exception_tb,
|
|
90
|
+
exception_state_name,
|
|
93
91
|
_exception_lineno,
|
|
94
92
|
) = context.variable_storage.getExceptionVariableDescriptions()
|
|
95
93
|
|
|
96
94
|
generator_exit = template_coroutine_exception_exit % {
|
|
97
95
|
"function_cleanup": indented(function_cleanup),
|
|
98
|
-
"
|
|
99
|
-
"exception_value": exception_value,
|
|
100
|
-
"exception_tb": exception_tb,
|
|
96
|
+
"exception_state_name": exception_state_name,
|
|
101
97
|
}
|
|
102
98
|
else:
|
|
103
99
|
generator_exit = template_coroutine_noexception_exit % {
|
|
@@ -586,7 +586,7 @@ def generateDictOperationIteritemsCode(to_name, expression, emit, context):
|
|
|
586
586
|
generateCAPIObjectCode(
|
|
587
587
|
to_name=to_name,
|
|
588
588
|
capi="DICT_ITERITEMS",
|
|
589
|
-
tstate=
|
|
589
|
+
tstate=True,
|
|
590
590
|
arg_desc=(("dict_arg", expression.subnode_dict_arg),),
|
|
591
591
|
may_raise=expression.mayRaiseException(BaseException),
|
|
592
592
|
conversion_check=decideConversionCheckNeeded(to_name, expression),
|
|
@@ -628,7 +628,7 @@ def generateDictOperationIterkeysCode(to_name, expression, emit, context):
|
|
|
628
628
|
generateCAPIObjectCode(
|
|
629
629
|
to_name=to_name,
|
|
630
630
|
capi="DICT_ITERKEYS",
|
|
631
|
-
tstate=
|
|
631
|
+
tstate=True,
|
|
632
632
|
arg_desc=(("dict_arg", expression.subnode_dict_arg),),
|
|
633
633
|
may_raise=False,
|
|
634
634
|
conversion_check=decideConversionCheckNeeded(to_name, expression),
|
|
@@ -715,7 +715,7 @@ def generateDictOperationItervaluesCode(to_name, expression, emit, context):
|
|
|
715
715
|
generateCAPIObjectCode(
|
|
716
716
|
to_name=to_name,
|
|
717
717
|
capi="DICT_ITERVALUES",
|
|
718
|
-
tstate=
|
|
718
|
+
tstate=True,
|
|
719
719
|
arg_desc=(("dict_arg", expression.subnode_dict_arg),),
|
|
720
720
|
may_raise=False,
|
|
721
721
|
conversion_check=decideConversionCheckNeeded(to_name, expression),
|