Nuitka-winsvc 2.1.6__cp311-cp311-win_amd64.whl → 2.2.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.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +232 -223
- nuitka/Errors.py +4 -0
- nuitka/HardImportRegistry.py +18 -1
- nuitka/MainControl.py +27 -30
- nuitka/OptionParsing.py +32 -30
- nuitka/Options.py +26 -13
- nuitka/OutputDirectories.py +7 -4
- nuitka/PostProcessing.py +9 -7
- nuitka/Progress.py +3 -3
- nuitka/PythonVersions.py +2 -2
- nuitka/TreeXML.py +1 -1
- nuitka/Version.py +1 -1
- nuitka/build/Backend.scons +2 -1
- nuitka/build/DataComposerInterface.py +1 -0
- nuitka/build/Onefile.scons +2 -1
- nuitka/build/SconsCaching.py +64 -46
- nuitka/build/SconsCompilerSettings.py +19 -6
- nuitka/build/SconsHacks.py +0 -1
- nuitka/build/SconsInterface.py +84 -5
- nuitka/build/SconsProgress.py +0 -1
- nuitka/build/SconsUtils.py +8 -4
- nuitka/build/include/nuitka/allocator.h +8 -3
- nuitka/build/include/nuitka/compiled_cell.h +8 -0
- nuitka/build/include/nuitka/exceptions.h +554 -179
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +3 -0
- nuitka/build/include/nuitka/helper/ints.h +15 -2
- nuitka/build/include/nuitka/helper/lists.h +4 -1
- nuitka/build/include/nuitka/helper/raising.h +12 -0
- nuitka/build/include/nuitka/helper/tuples.h +5 -1
- nuitka/build/include/nuitka/helpers.h +4 -0
- nuitka/build/include/nuitka/importing.h +3 -4
- nuitka/build/include/nuitka/jit_sources.h +25 -0
- nuitka/build/include/nuitka/prelude.h +38 -11
- nuitka/build/include/nuitka/printing.h +3 -0
- nuitka/build/include/nuitka/threading.h +2 -6
- nuitka/build/include/nuitka/type_aliases.h +27 -0
- nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
- nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
- nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
- nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
- nuitka/build/static_src/CompiledCoroutineType.c +96 -114
- nuitka/build/static_src/CompiledFrameType.c +14 -11
- nuitka/build/static_src/CompiledFunctionType.c +34 -7
- nuitka/build/static_src/CompiledGeneratorType.c +248 -142
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
- nuitka/build/static_src/CompiledMethodType.c +8 -7
- nuitka/build/static_src/HelpersAttributes.c +2 -19
- nuitka/build/static_src/HelpersBuiltin.c +2 -1
- nuitka/build/static_src/HelpersComparisonEq.c +32 -18
- nuitka/build/static_src/HelpersComparisonGe.c +50 -36
- nuitka/build/static_src/HelpersComparisonGt.c +50 -36
- nuitka/build/static_src/HelpersComparisonLe.c +50 -36
- nuitka/build/static_src/HelpersComparisonLt.c +50 -36
- nuitka/build/static_src/HelpersComparisonNe.c +32 -18
- nuitka/build/static_src/HelpersDeepcopy.c +6 -8
- nuitka/build/static_src/HelpersDictionaries.c +8 -3
- nuitka/build/static_src/HelpersExceptions.c +36 -22
- nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
- nuitka/build/static_src/HelpersImportHard.c +15 -0
- nuitka/build/static_src/HelpersJitSources.c +46 -0
- nuitka/build/static_src/HelpersLists.c +40 -0
- nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
- nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
- nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
- nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
- nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
- nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
- nuitka/build/static_src/HelpersProfiling.c +3 -4
- nuitka/build/static_src/HelpersRaising.c +62 -1
- nuitka/build/static_src/HelpersStrings.c +203 -8
- nuitka/build/static_src/HelpersTypes.c +42 -0
- nuitka/build/static_src/MainProgram.c +1 -1
- nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
- nuitka/build/static_src/OnefileBootstrap.c +3 -3
- nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
- nuitka/code_generation/BuiltinCodes.py +1 -0
- nuitka/code_generation/CodeGeneration.py +11 -0
- nuitka/code_generation/CodeHelpers.py +5 -3
- nuitka/code_generation/CodeObjectCodes.py +10 -6
- nuitka/code_generation/ComparisonCodes.py +19 -3
- nuitka/code_generation/ConstantCodes.py +5 -0
- nuitka/code_generation/Contexts.py +22 -6
- nuitka/code_generation/Emission.py +1 -0
- nuitka/code_generation/ErrorCodes.py +8 -16
- nuitka/code_generation/EvalCodes.py +5 -3
- nuitka/code_generation/ExceptionCodes.py +8 -1
- nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
- nuitka/code_generation/FrameCodes.py +5 -3
- nuitka/code_generation/FunctionCodes.py +0 -1
- nuitka/code_generation/GeneratorCodes.py +3 -3
- nuitka/code_generation/GlobalConstants.py +0 -2
- nuitka/code_generation/ImportCodes.py +2 -0
- nuitka/code_generation/JitCodes.py +44 -0
- nuitka/code_generation/ListCodes.py +11 -17
- nuitka/code_generation/MatchCodes.py +0 -1
- nuitka/code_generation/ModuleCodes.py +2 -1
- nuitka/code_generation/Namify.py +0 -1
- nuitka/code_generation/NetworkxCodes.py +51 -0
- nuitka/code_generation/OperationCodes.py +8 -6
- nuitka/code_generation/PackageResourceCodes.py +7 -5
- nuitka/code_generation/TensorflowCodes.py +54 -0
- nuitka/code_generation/TypeAliasCodes.py +71 -0
- nuitka/code_generation/VariableCodes.py +7 -5
- nuitka/code_generation/VariableDeclarations.py +1 -0
- nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
- nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
- nuitka/code_generation/c_types/CTypeVoids.py +1 -0
- nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
- nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
- nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
- nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
- nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
- nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
- nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
- nuitka/containers/Namedtuples.py +0 -1
- nuitka/finalizations/Finalization.py +1 -0
- nuitka/finalizations/FinalizeMarkups.py +0 -1
- nuitka/freezer/DllDependenciesMacOS.py +60 -13
- nuitka/freezer/DllDependenciesPosix.py +0 -1
- nuitka/freezer/IncludedDataFiles.py +46 -15
- nuitka/freezer/IncludedEntryPoints.py +5 -3
- nuitka/freezer/Standalone.py +6 -1
- nuitka/importing/ImportCache.py +2 -2
- nuitka/importing/ImportResolving.py +80 -78
- nuitka/importing/Importing.py +34 -1
- nuitka/nodes/AttributeNodesGenerated.py +21 -6
- nuitka/nodes/BuiltinComplexNodes.py +1 -0
- nuitka/nodes/BuiltinFormatNodes.py +1 -0
- nuitka/nodes/BuiltinIteratorNodes.py +5 -3
- nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
- nuitka/nodes/BuiltinRefNodes.py +8 -1
- nuitka/nodes/BuiltinVarsNodes.py +0 -1
- nuitka/nodes/ChildrenHavingMixins.py +906 -186
- nuitka/nodes/CodeObjectSpecs.py +1 -1
- nuitka/nodes/ConstantRefNodes.py +38 -0
- nuitka/nodes/CtypesNodes.py +0 -1
- nuitka/nodes/DictionaryNodes.py +0 -1
- nuitka/nodes/ExceptionNodes.py +10 -0
- nuitka/nodes/ExpressionBases.py +15 -9
- nuitka/nodes/ExpressionBasesGenerated.py +32 -15
- nuitka/nodes/FunctionNodes.py +50 -5
- nuitka/nodes/HardImportNodesGenerated.py +245 -60
- nuitka/nodes/ImportHardNodes.py +27 -13
- nuitka/nodes/ImportNodes.py +90 -70
- nuitka/nodes/InjectCNodes.py +0 -1
- nuitka/nodes/ModuleNodes.py +10 -5
- nuitka/nodes/NetworkxNodes.py +45 -0
- nuitka/nodes/OperatorNodesUnary.py +1 -0
- nuitka/nodes/OsSysNodes.py +0 -1
- nuitka/nodes/PackageMetadataNodes.py +0 -1
- nuitka/nodes/PackageResourceNodes.py +10 -6
- nuitka/nodes/StatementBasesGenerated.py +107 -60
- nuitka/nodes/StringConcatenationNodes.py +1 -0
- nuitka/nodes/TensorflowNodes.py +38 -0
- nuitka/nodes/TypeNodes.py +21 -0
- nuitka/nodes/VariableRefNodes.py +1 -0
- nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
- nuitka/optimizations/Optimization.py +7 -6
- nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
- nuitka/optimizations/Tags.py +0 -1
- nuitka/optimizations/TraceCollections.py +6 -55
- nuitka/optimizations/ValueTraces.py +49 -1
- nuitka/plugins/PluginBase.py +26 -4
- nuitka/plugins/Plugins.py +49 -12
- nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
- nuitka/plugins/standard/DataFilesPlugin.py +2 -6
- nuitka/plugins/standard/DillPlugin.py +3 -3
- nuitka/plugins/standard/DllFilesPlugin.py +29 -23
- nuitka/plugins/standard/GiPlugin.py +1 -0
- nuitka/plugins/standard/ImplicitImports.py +8 -7
- nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
- nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
- nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
- nuitka/plugins/standard/PmwPlugin.py +10 -9
- nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
- nuitka/plugins/standard/TensorflowPlugin.py +1 -0
- nuitka/plugins/standard/TorchPlugin.py +1 -0
- nuitka/plugins/standard/TrioPlugin.py +1 -0
- nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -34
- nuitka/reports/CompilationReportReader.py +0 -1
- nuitka/reports/Reports.py +49 -5
- nuitka/specs/BuiltinParameterSpecs.py +10 -2
- nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
- nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
- nuitka/specs/HardImportSpecs.py +34 -1
- nuitka/specs/ParameterSpecs.py +11 -9
- nuitka/tools/environments/Virtualenv.py +0 -1
- nuitka/tools/specialize/CTypeDescriptions.py +15 -11
- nuitka/tools/specialize/SpecializeC.py +11 -9
- nuitka/tools/specialize/SpecializePython.py +57 -30
- nuitka/tools/testing/Common.py +24 -7
- nuitka/tools/testing/OutputComparison.py +4 -0
- nuitka/tools/testing/Pythons.py +0 -1
- nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
- nuitka/tools/watch/GitHub.py +4 -1
- nuitka/tools/watch/__main__.py +22 -1
- nuitka/tree/Building.py +3 -0
- nuitka/tree/InternalModule.py +0 -1
- nuitka/tree/ReformulationAssertStatements.py +1 -0
- nuitka/tree/ReformulationAssignmentStatements.py +26 -3
- nuitka/tree/ReformulationClasses3.py +23 -26
- nuitka/tree/ReformulationContractionExpressions.py +5 -3
- nuitka/tree/ReformulationDictionaryCreation.py +6 -5
- nuitka/tree/ReformulationExecStatements.py +8 -6
- nuitka/tree/ReformulationFunctionStatements.py +10 -6
- nuitka/tree/SourceHandling.py +8 -0
- nuitka/tree/TreeHelpers.py +6 -3
- nuitka/utils/AppDirs.py +6 -2
- nuitka/utils/CStrings.py +1 -1
- nuitka/utils/CommandLineOptions.py +0 -1
- nuitka/utils/Distributions.py +3 -3
- nuitka/utils/Download.py +5 -1
- nuitka/utils/Execution.py +6 -3
- nuitka/utils/FileOperations.py +61 -34
- nuitka/utils/Importing.py +4 -4
- nuitka/utils/InstanceCounters.py +1 -0
- nuitka/utils/MacOSApp.py +1 -0
- nuitka/utils/Shebang.py +1 -0
- nuitka/utils/Utils.py +39 -1
- nuitka/utils/WindowsFileUsage.py +4 -3
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
nuitka/nodes/CodeObjectSpecs.py
CHANGED
nuitka/nodes/ConstantRefNodes.py
CHANGED
|
@@ -694,6 +694,25 @@ class ExpressionConstantListRef(
|
|
|
694
694
|
"""Iteration over constant list lowered to tuple.""",
|
|
695
695
|
)
|
|
696
696
|
|
|
697
|
+
def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):
|
|
698
|
+
result = makeConstantRefNode(
|
|
699
|
+
constant=tuple(self.constant),
|
|
700
|
+
user_provided=self.user_provided,
|
|
701
|
+
source_ref=self.source_ref,
|
|
702
|
+
)
|
|
703
|
+
|
|
704
|
+
self.parent.replaceChild(self, result)
|
|
705
|
+
self.finalize()
|
|
706
|
+
|
|
707
|
+
# We did not know this before
|
|
708
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
709
|
+
|
|
710
|
+
return (
|
|
711
|
+
in_node,
|
|
712
|
+
"new_constant",
|
|
713
|
+
"""Contains test over constant list lowered to tuple.""",
|
|
714
|
+
)
|
|
715
|
+
|
|
697
716
|
|
|
698
717
|
class ExpressionConstantListEmptyRef(EmptyContainerMixin, ExpressionConstantListRef):
|
|
699
718
|
kind = "EXPRESSION_CONSTANT_LIST_EMPTY_REF"
|
|
@@ -757,6 +776,25 @@ class ExpressionConstantSetRef(ExpressionSetShapeExactMixin, ExpressionConstantR
|
|
|
757
776
|
"""Iteration over constant set lowered to tuple.""",
|
|
758
777
|
)
|
|
759
778
|
|
|
779
|
+
def computeExpressionComparisonIn(self, in_node, value_node, trace_collection):
|
|
780
|
+
result = makeConstantRefNode(
|
|
781
|
+
constant=frozenset(self.constant),
|
|
782
|
+
user_provided=self.user_provided,
|
|
783
|
+
source_ref=self.source_ref,
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
self.parent.replaceChild(self, result)
|
|
787
|
+
self.finalize()
|
|
788
|
+
|
|
789
|
+
# We did not know this before
|
|
790
|
+
trace_collection.onExceptionRaiseExit(BaseException)
|
|
791
|
+
|
|
792
|
+
return (
|
|
793
|
+
in_node,
|
|
794
|
+
"new_constant",
|
|
795
|
+
"""Contains test over constant set lowered to frozenset.""",
|
|
796
|
+
)
|
|
797
|
+
|
|
760
798
|
|
|
761
799
|
class ExpressionConstantSetEmptyRef(EmptyContainerMixin, ExpressionConstantSetRef):
|
|
762
800
|
kind = "EXPRESSION_CONSTANT_SET_EMPTY_REF"
|
nuitka/nodes/CtypesNodes.py
CHANGED
nuitka/nodes/DictionaryNodes.py
CHANGED
nuitka/nodes/ExceptionNodes.py
CHANGED
|
@@ -220,6 +220,16 @@ class ExpressionBuiltinMakeExceptionImportError(
|
|
|
220
220
|
return False
|
|
221
221
|
|
|
222
222
|
|
|
223
|
+
class ExpressionBuiltinMakeExceptionModuleNotFoundError(
|
|
224
|
+
ExpressionBuiltinMakeExceptionImportError
|
|
225
|
+
):
|
|
226
|
+
kind = "EXPRESSION_BUILTIN_MAKE_EXCEPTION_MODULE_NOT_FOUND_ERROR"
|
|
227
|
+
|
|
228
|
+
@staticmethod
|
|
229
|
+
def getExceptionName():
|
|
230
|
+
return "ModuleNotFoundError"
|
|
231
|
+
|
|
232
|
+
|
|
223
233
|
class ExpressionCaughtMixin(ExpressionNoSideEffectsMixin):
|
|
224
234
|
"""Common things for all caught exception references."""
|
|
225
235
|
|
nuitka/nodes/ExpressionBases.py
CHANGED
|
@@ -446,9 +446,11 @@ class ExpressionBase(NodeBase):
|
|
|
446
446
|
trace_collection.onExceptionRaiseExit(BaseException)
|
|
447
447
|
|
|
448
448
|
return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(
|
|
449
|
-
template=
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
template=(
|
|
450
|
+
"int() argument must be a string or a number, not '%s'"
|
|
451
|
+
if python_version < 0x300
|
|
452
|
+
else "int() argument must be a string, a bytes-like object or a number, not '%s'"
|
|
453
|
+
),
|
|
452
454
|
operation="int",
|
|
453
455
|
original_node=int_node,
|
|
454
456
|
value_node=self,
|
|
@@ -496,9 +498,11 @@ class ExpressionBase(NodeBase):
|
|
|
496
498
|
trace_collection.onExceptionRaiseExit(BaseException)
|
|
497
499
|
|
|
498
500
|
return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
501
|
+
(
|
|
502
|
+
"float() argument must be a string or a number"
|
|
503
|
+
if Options.is_full_compat and python_version < 0x300
|
|
504
|
+
else "float() argument must be a string or a number, not '%s'"
|
|
505
|
+
),
|
|
502
506
|
operation="long",
|
|
503
507
|
original_node=float_node,
|
|
504
508
|
value_node=self,
|
|
@@ -550,9 +554,11 @@ class ExpressionBase(NodeBase):
|
|
|
550
554
|
trace_collection.onExceptionRaiseExit(BaseException)
|
|
551
555
|
|
|
552
556
|
return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
557
|
+
(
|
|
558
|
+
"complex() argument must be a string or a number"
|
|
559
|
+
if Options.is_full_compat and python_version < 0x300
|
|
560
|
+
else "complex() argument must be a string or a number, not '%s'"
|
|
561
|
+
),
|
|
556
562
|
operation="complex",
|
|
557
563
|
original_node=complex_node,
|
|
558
564
|
value_node=self,
|
|
@@ -2,18 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
# We are not avoiding these in generated code at all
|
|
5
|
-
# pylint: disable=I0021,too-many-lines
|
|
6
|
-
# pylint: disable=I0021,
|
|
7
|
-
# pylint: disable=I0021,too-many-instance-attributes
|
|
8
|
-
# pylint: disable=I0021,too-many-return-statements
|
|
5
|
+
# pylint: disable=I0021,line-too-long,too-many-instance-attributes,too-many-lines
|
|
6
|
+
# pylint: disable=I0021,too-many-arguments,too-many-return-statements,too-many-statements
|
|
9
7
|
|
|
10
8
|
|
|
11
9
|
"""Children having expression bases
|
|
12
10
|
|
|
13
11
|
WARNING, this code is GENERATED. Modify the template ChildrenHavingMixin.py.j2 instead!
|
|
14
12
|
|
|
15
|
-
spell-checker: ignore append
|
|
16
|
-
spell-checker: ignore
|
|
13
|
+
spell-checker: ignore __prepare__ append args autograph buffering capitalize casefold
|
|
14
|
+
spell-checker: ignore center chars clear closefd copy count decode default delete dist
|
|
15
|
+
spell-checker: ignore distribution_name encode encoding end endswith errors exit_code
|
|
16
|
+
spell-checker: ignore expandtabs experimental_attributes experimental_autograph_options
|
|
17
|
+
spell-checker: ignore experimental_compile experimental_follow_type_hints
|
|
18
|
+
spell-checker: ignore experimental_implements experimental_relax_shapes extend file
|
|
19
|
+
spell-checker: ignore fillchar find format format_map formatmap fromkeys func get group
|
|
20
|
+
spell-checker: ignore handle has_key haskey index input_signature insert isalnum isalpha
|
|
21
|
+
spell-checker: ignore isascii isdecimal isdigit isidentifier islower isnumeric isprintable
|
|
22
|
+
spell-checker: ignore isspace istitle isupper item items iterable iteritems iterkeys
|
|
23
|
+
spell-checker: ignore itervalues jit_compile join keepends key keys kwargs ljust lower
|
|
24
|
+
spell-checker: ignore lstrip maketrans maxsplit mode name new newline old opener p package
|
|
25
|
+
spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
|
|
26
|
+
spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
|
|
27
|
+
spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
|
|
28
|
+
spell-checker: ignore sort split splitlines start startswith stop strip sub suffix
|
|
29
|
+
spell-checker: ignore swapcase table tabsize title translate update upper use_errno
|
|
30
|
+
spell-checker: ignore use_last_error value values viewitems viewkeys viewvalues width
|
|
31
|
+
spell-checker: ignore winmode zfill
|
|
17
32
|
"""
|
|
18
33
|
|
|
19
34
|
|
|
@@ -283,12 +298,12 @@ class ChildrenHavingArgsTupleNameOptionalPathOptionalFinalNoRaiseMixin(Expressio
|
|
|
283
298
|
|
|
284
299
|
values = {
|
|
285
300
|
"args": tuple(v.makeClone() for v in self.subnode_args),
|
|
286
|
-
"name":
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"path":
|
|
290
|
-
|
|
291
|
-
|
|
301
|
+
"name": (
|
|
302
|
+
self.subnode_name.makeClone() if self.subnode_name is not None else None
|
|
303
|
+
),
|
|
304
|
+
"path": (
|
|
305
|
+
self.subnode_path.makeClone() if self.subnode_path is not None else None
|
|
306
|
+
),
|
|
292
307
|
}
|
|
293
308
|
|
|
294
309
|
values.update(self.getDetails())
|
|
@@ -1631,9 +1646,11 @@ class ChildHavingPromptOptionalFinalMixin(ExpressionBase):
|
|
|
1631
1646
|
"""
|
|
1632
1647
|
|
|
1633
1648
|
values = {
|
|
1634
|
-
"prompt":
|
|
1635
|
-
|
|
1636
|
-
|
|
1649
|
+
"prompt": (
|
|
1650
|
+
self.subnode_prompt.makeClone()
|
|
1651
|
+
if self.subnode_prompt is not None
|
|
1652
|
+
else None
|
|
1653
|
+
),
|
|
1637
1654
|
}
|
|
1638
1655
|
|
|
1639
1656
|
values.update(self.getDetails())
|
nuitka/nodes/FunctionNodes.py
CHANGED
|
@@ -16,6 +16,7 @@ classes.
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
import inspect
|
|
19
|
+
import re
|
|
19
20
|
|
|
20
21
|
from nuitka import Options, Variables
|
|
21
22
|
from nuitka.Constants import isMutable
|
|
@@ -29,8 +30,9 @@ from nuitka.specs.ParameterSpecs import (
|
|
|
29
30
|
TooManyArguments,
|
|
30
31
|
matchCall,
|
|
31
32
|
)
|
|
32
|
-
from nuitka.Tracing import optimization_logger
|
|
33
|
+
from nuitka.Tracing import optimization_logger, printError
|
|
33
34
|
from nuitka.tree.Extractions import updateVariableUsage
|
|
35
|
+
from nuitka.tree.SourceHandling import readSourceLines
|
|
34
36
|
from nuitka.tree.TreeHelpers import makeDictCreationOrConstant2
|
|
35
37
|
|
|
36
38
|
from .ChildrenHavingMixins import (
|
|
@@ -806,9 +808,11 @@ class ExpressionFunctionPureBody(ExpressionFunctionBody):
|
|
|
806
808
|
"{source_ref} : {tags} : {message}".format(
|
|
807
809
|
source_ref=source_ref.getAsString(),
|
|
808
810
|
tags=tag,
|
|
809
|
-
message=
|
|
810
|
-
|
|
811
|
-
|
|
811
|
+
message=(
|
|
812
|
+
change_desc()
|
|
813
|
+
if inspect.isfunction(change_desc)
|
|
814
|
+
else change_desc
|
|
815
|
+
),
|
|
812
816
|
)
|
|
813
817
|
)
|
|
814
818
|
|
|
@@ -1100,7 +1104,7 @@ if python_version < 0x340:
|
|
|
1100
1104
|
class ExpressionFunctionRef(ExpressionNoSideEffectsMixin, ExpressionBase):
|
|
1101
1105
|
kind = "EXPRESSION_FUNCTION_REF"
|
|
1102
1106
|
|
|
1103
|
-
__slots__ = "function_body", "code_name"
|
|
1107
|
+
__slots__ = "function_body", "code_name", "function_source"
|
|
1104
1108
|
|
|
1105
1109
|
def __init__(self, source_ref, function_body=None, code_name=None):
|
|
1106
1110
|
assert function_body is not None or code_name is not None
|
|
@@ -1110,10 +1114,12 @@ class ExpressionFunctionRef(ExpressionNoSideEffectsMixin, ExpressionBase):
|
|
|
1110
1114
|
|
|
1111
1115
|
self.function_body = function_body
|
|
1112
1116
|
self.code_name = code_name
|
|
1117
|
+
self.function_source = None
|
|
1113
1118
|
|
|
1114
1119
|
def finalize(self):
|
|
1115
1120
|
del self.parent
|
|
1116
1121
|
del self.function_body
|
|
1122
|
+
del self.function_source
|
|
1117
1123
|
|
|
1118
1124
|
def getName(self):
|
|
1119
1125
|
return self.function_body.getName()
|
|
@@ -1142,6 +1148,45 @@ class ExpressionFunctionRef(ExpressionNoSideEffectsMixin, ExpressionBase):
|
|
|
1142
1148
|
# TODO: Function after collection may now know something.
|
|
1143
1149
|
return self, None, None
|
|
1144
1150
|
|
|
1151
|
+
def getFunctionSourceCode(self):
|
|
1152
|
+
if self.function_source is None:
|
|
1153
|
+
try:
|
|
1154
|
+
lines = readSourceLines(self.getFunctionBody().source_ref)
|
|
1155
|
+
|
|
1156
|
+
# This needs to match "inspect.findsource".
|
|
1157
|
+
pat = re.compile(
|
|
1158
|
+
r"^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)"
|
|
1159
|
+
)
|
|
1160
|
+
|
|
1161
|
+
line_number = self.source_ref.line - 1
|
|
1162
|
+
|
|
1163
|
+
while line_number > 0:
|
|
1164
|
+
line = lines[line_number]
|
|
1165
|
+
|
|
1166
|
+
if pat.match(line):
|
|
1167
|
+
break
|
|
1168
|
+
|
|
1169
|
+
line_number = line_number - 1
|
|
1170
|
+
|
|
1171
|
+
self.function_source = (
|
|
1172
|
+
"".join(inspect.getblock(lines[line_number:])),
|
|
1173
|
+
line_number,
|
|
1174
|
+
)
|
|
1175
|
+
except Exception:
|
|
1176
|
+
printError(
|
|
1177
|
+
"Problem with retrieving source code of '%s' at %s"
|
|
1178
|
+
% (self.getFunctionSuperQualifiedName(), self.source_ref)
|
|
1179
|
+
)
|
|
1180
|
+
raise
|
|
1181
|
+
|
|
1182
|
+
return self.function_source
|
|
1183
|
+
|
|
1184
|
+
def getFunctionSuperQualifiedName(self):
|
|
1185
|
+
return "%s.%s" % (
|
|
1186
|
+
self.getParentModule().getFullName(),
|
|
1187
|
+
self.getFunctionBody().getFunctionQualname(),
|
|
1188
|
+
)
|
|
1189
|
+
|
|
1145
1190
|
|
|
1146
1191
|
def makeExpressionFunctionCall(function, values, source_ref):
|
|
1147
1192
|
assert function.isExpressionFunctionCreation()
|