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.

Files changed (232) hide show
  1. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/RECORD +232 -223
  3. nuitka/Errors.py +4 -0
  4. nuitka/HardImportRegistry.py +18 -1
  5. nuitka/MainControl.py +27 -30
  6. nuitka/OptionParsing.py +32 -30
  7. nuitka/Options.py +26 -13
  8. nuitka/OutputDirectories.py +7 -4
  9. nuitka/PostProcessing.py +9 -7
  10. nuitka/Progress.py +3 -3
  11. nuitka/PythonVersions.py +2 -2
  12. nuitka/TreeXML.py +1 -1
  13. nuitka/Version.py +1 -1
  14. nuitka/build/Backend.scons +2 -1
  15. nuitka/build/DataComposerInterface.py +1 -0
  16. nuitka/build/Onefile.scons +2 -1
  17. nuitka/build/SconsCaching.py +64 -46
  18. nuitka/build/SconsCompilerSettings.py +19 -6
  19. nuitka/build/SconsHacks.py +0 -1
  20. nuitka/build/SconsInterface.py +84 -5
  21. nuitka/build/SconsProgress.py +0 -1
  22. nuitka/build/SconsUtils.py +8 -4
  23. nuitka/build/include/nuitka/allocator.h +8 -3
  24. nuitka/build/include/nuitka/compiled_cell.h +8 -0
  25. nuitka/build/include/nuitka/exceptions.h +554 -179
  26. nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
  27. nuitka/build/include/nuitka/helper/import_hard.h +3 -0
  28. nuitka/build/include/nuitka/helper/ints.h +15 -2
  29. nuitka/build/include/nuitka/helper/lists.h +4 -1
  30. nuitka/build/include/nuitka/helper/raising.h +12 -0
  31. nuitka/build/include/nuitka/helper/tuples.h +5 -1
  32. nuitka/build/include/nuitka/helpers.h +4 -0
  33. nuitka/build/include/nuitka/importing.h +3 -4
  34. nuitka/build/include/nuitka/jit_sources.h +25 -0
  35. nuitka/build/include/nuitka/prelude.h +38 -11
  36. nuitka/build/include/nuitka/printing.h +3 -0
  37. nuitka/build/include/nuitka/threading.h +2 -6
  38. nuitka/build/include/nuitka/type_aliases.h +27 -0
  39. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  40. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
  41. nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
  42. nuitka/build/static_src/CompiledCodeHelpers.c +24 -14
  43. nuitka/build/static_src/CompiledCoroutineType.c +96 -114
  44. nuitka/build/static_src/CompiledFrameType.c +14 -11
  45. nuitka/build/static_src/CompiledFunctionType.c +34 -7
  46. nuitka/build/static_src/CompiledGeneratorType.c +248 -142
  47. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
  48. nuitka/build/static_src/CompiledMethodType.c +8 -7
  49. nuitka/build/static_src/HelpersAttributes.c +2 -19
  50. nuitka/build/static_src/HelpersBuiltin.c +2 -1
  51. nuitka/build/static_src/HelpersComparisonEq.c +32 -18
  52. nuitka/build/static_src/HelpersComparisonGe.c +50 -36
  53. nuitka/build/static_src/HelpersComparisonGt.c +50 -36
  54. nuitka/build/static_src/HelpersComparisonLe.c +50 -36
  55. nuitka/build/static_src/HelpersComparisonLt.c +50 -36
  56. nuitka/build/static_src/HelpersComparisonNe.c +32 -18
  57. nuitka/build/static_src/HelpersDeepcopy.c +6 -8
  58. nuitka/build/static_src/HelpersDictionaries.c +8 -3
  59. nuitka/build/static_src/HelpersExceptions.c +36 -22
  60. nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
  61. nuitka/build/static_src/HelpersImportHard.c +15 -0
  62. nuitka/build/static_src/HelpersJitSources.c +46 -0
  63. nuitka/build/static_src/HelpersLists.c +40 -0
  64. nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
  65. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
  66. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
  67. nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
  68. nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
  69. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
  70. nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
  71. nuitka/build/static_src/HelpersProfiling.c +3 -4
  72. nuitka/build/static_src/HelpersRaising.c +62 -1
  73. nuitka/build/static_src/HelpersStrings.c +203 -8
  74. nuitka/build/static_src/HelpersTypes.c +42 -0
  75. nuitka/build/static_src/MainProgram.c +1 -1
  76. nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
  77. nuitka/build/static_src/OnefileBootstrap.c +3 -3
  78. nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
  79. nuitka/code_generation/BuiltinCodes.py +1 -0
  80. nuitka/code_generation/CodeGeneration.py +11 -0
  81. nuitka/code_generation/CodeHelpers.py +5 -3
  82. nuitka/code_generation/CodeObjectCodes.py +10 -6
  83. nuitka/code_generation/ComparisonCodes.py +19 -3
  84. nuitka/code_generation/ConstantCodes.py +5 -0
  85. nuitka/code_generation/Contexts.py +22 -6
  86. nuitka/code_generation/Emission.py +1 -0
  87. nuitka/code_generation/ErrorCodes.py +8 -16
  88. nuitka/code_generation/EvalCodes.py +5 -3
  89. nuitka/code_generation/ExceptionCodes.py +8 -1
  90. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
  91. nuitka/code_generation/FrameCodes.py +5 -3
  92. nuitka/code_generation/FunctionCodes.py +0 -1
  93. nuitka/code_generation/GeneratorCodes.py +3 -3
  94. nuitka/code_generation/GlobalConstants.py +0 -2
  95. nuitka/code_generation/ImportCodes.py +2 -0
  96. nuitka/code_generation/JitCodes.py +44 -0
  97. nuitka/code_generation/ListCodes.py +11 -17
  98. nuitka/code_generation/MatchCodes.py +0 -1
  99. nuitka/code_generation/ModuleCodes.py +2 -1
  100. nuitka/code_generation/Namify.py +0 -1
  101. nuitka/code_generation/NetworkxCodes.py +51 -0
  102. nuitka/code_generation/OperationCodes.py +8 -6
  103. nuitka/code_generation/PackageResourceCodes.py +7 -5
  104. nuitka/code_generation/TensorflowCodes.py +54 -0
  105. nuitka/code_generation/TypeAliasCodes.py +71 -0
  106. nuitka/code_generation/VariableCodes.py +7 -5
  107. nuitka/code_generation/VariableDeclarations.py +1 -0
  108. nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
  109. nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
  110. nuitka/code_generation/c_types/CTypeVoids.py +1 -0
  111. nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
  112. nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
  113. nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
  114. nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
  115. nuitka/code_generation/templates/CodeTemplatesModules.py +4 -1
  116. nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
  117. nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
  118. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
  119. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
  120. nuitka/containers/Namedtuples.py +0 -1
  121. nuitka/finalizations/Finalization.py +1 -0
  122. nuitka/finalizations/FinalizeMarkups.py +0 -1
  123. nuitka/freezer/DllDependenciesMacOS.py +60 -13
  124. nuitka/freezer/DllDependenciesPosix.py +0 -1
  125. nuitka/freezer/IncludedDataFiles.py +46 -15
  126. nuitka/freezer/IncludedEntryPoints.py +5 -3
  127. nuitka/freezer/Standalone.py +6 -1
  128. nuitka/importing/ImportCache.py +2 -2
  129. nuitka/importing/ImportResolving.py +80 -78
  130. nuitka/importing/Importing.py +34 -1
  131. nuitka/nodes/AttributeNodesGenerated.py +21 -6
  132. nuitka/nodes/BuiltinComplexNodes.py +1 -0
  133. nuitka/nodes/BuiltinFormatNodes.py +1 -0
  134. nuitka/nodes/BuiltinIteratorNodes.py +5 -3
  135. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
  136. nuitka/nodes/BuiltinRefNodes.py +8 -1
  137. nuitka/nodes/BuiltinVarsNodes.py +0 -1
  138. nuitka/nodes/ChildrenHavingMixins.py +906 -186
  139. nuitka/nodes/CodeObjectSpecs.py +1 -1
  140. nuitka/nodes/ConstantRefNodes.py +38 -0
  141. nuitka/nodes/CtypesNodes.py +0 -1
  142. nuitka/nodes/DictionaryNodes.py +0 -1
  143. nuitka/nodes/ExceptionNodes.py +10 -0
  144. nuitka/nodes/ExpressionBases.py +15 -9
  145. nuitka/nodes/ExpressionBasesGenerated.py +32 -15
  146. nuitka/nodes/FunctionNodes.py +50 -5
  147. nuitka/nodes/HardImportNodesGenerated.py +245 -60
  148. nuitka/nodes/ImportHardNodes.py +27 -13
  149. nuitka/nodes/ImportNodes.py +90 -70
  150. nuitka/nodes/InjectCNodes.py +0 -1
  151. nuitka/nodes/ModuleNodes.py +10 -5
  152. nuitka/nodes/NetworkxNodes.py +45 -0
  153. nuitka/nodes/OperatorNodesUnary.py +1 -0
  154. nuitka/nodes/OsSysNodes.py +0 -1
  155. nuitka/nodes/PackageMetadataNodes.py +0 -1
  156. nuitka/nodes/PackageResourceNodes.py +10 -6
  157. nuitka/nodes/StatementBasesGenerated.py +107 -60
  158. nuitka/nodes/StringConcatenationNodes.py +1 -0
  159. nuitka/nodes/TensorflowNodes.py +38 -0
  160. nuitka/nodes/TypeNodes.py +21 -0
  161. nuitka/nodes/VariableRefNodes.py +1 -0
  162. nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
  163. nuitka/optimizations/Optimization.py +7 -6
  164. nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
  165. nuitka/optimizations/Tags.py +0 -1
  166. nuitka/optimizations/TraceCollections.py +6 -55
  167. nuitka/optimizations/ValueTraces.py +49 -1
  168. nuitka/plugins/PluginBase.py +26 -4
  169. nuitka/plugins/Plugins.py +49 -12
  170. nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
  171. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
  172. nuitka/plugins/standard/DataFilesPlugin.py +2 -6
  173. nuitka/plugins/standard/DillPlugin.py +3 -3
  174. nuitka/plugins/standard/DllFilesPlugin.py +29 -23
  175. nuitka/plugins/standard/GiPlugin.py +1 -0
  176. nuitka/plugins/standard/ImplicitImports.py +8 -7
  177. nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
  178. nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
  179. nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
  180. nuitka/plugins/standard/PmwPlugin.py +10 -9
  181. nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
  182. nuitka/plugins/standard/TensorflowPlugin.py +1 -0
  183. nuitka/plugins/standard/TorchPlugin.py +1 -0
  184. nuitka/plugins/standard/TrioPlugin.py +1 -0
  185. nuitka/plugins/standard/standard.nuitka-package.config.yml +242 -34
  186. nuitka/reports/CompilationReportReader.py +0 -1
  187. nuitka/reports/Reports.py +49 -5
  188. nuitka/specs/BuiltinParameterSpecs.py +10 -2
  189. nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
  190. nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
  191. nuitka/specs/HardImportSpecs.py +34 -1
  192. nuitka/specs/ParameterSpecs.py +11 -9
  193. nuitka/tools/environments/Virtualenv.py +0 -1
  194. nuitka/tools/specialize/CTypeDescriptions.py +15 -11
  195. nuitka/tools/specialize/SpecializeC.py +11 -9
  196. nuitka/tools/specialize/SpecializePython.py +57 -30
  197. nuitka/tools/testing/Common.py +24 -7
  198. nuitka/tools/testing/OutputComparison.py +4 -0
  199. nuitka/tools/testing/Pythons.py +0 -1
  200. nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
  201. nuitka/tools/watch/GitHub.py +4 -1
  202. nuitka/tools/watch/__main__.py +22 -1
  203. nuitka/tree/Building.py +3 -0
  204. nuitka/tree/InternalModule.py +0 -1
  205. nuitka/tree/ReformulationAssertStatements.py +1 -0
  206. nuitka/tree/ReformulationAssignmentStatements.py +26 -3
  207. nuitka/tree/ReformulationClasses3.py +23 -26
  208. nuitka/tree/ReformulationContractionExpressions.py +5 -3
  209. nuitka/tree/ReformulationDictionaryCreation.py +6 -5
  210. nuitka/tree/ReformulationExecStatements.py +8 -6
  211. nuitka/tree/ReformulationFunctionStatements.py +10 -6
  212. nuitka/tree/SourceHandling.py +8 -0
  213. nuitka/tree/TreeHelpers.py +6 -3
  214. nuitka/utils/AppDirs.py +6 -2
  215. nuitka/utils/CStrings.py +1 -1
  216. nuitka/utils/CommandLineOptions.py +0 -1
  217. nuitka/utils/Distributions.py +3 -3
  218. nuitka/utils/Download.py +5 -1
  219. nuitka/utils/Execution.py +6 -3
  220. nuitka/utils/FileOperations.py +61 -34
  221. nuitka/utils/Importing.py +4 -4
  222. nuitka/utils/InstanceCounters.py +1 -0
  223. nuitka/utils/MacOSApp.py +1 -0
  224. nuitka/utils/Shebang.py +1 -0
  225. nuitka/utils/Utils.py +39 -1
  226. nuitka/utils/WindowsFileUsage.py +4 -3
  227. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka-run.bat +0 -0
  228. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.1.data}/scripts/nuitka.bat +0 -0
  229. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/LICENSE.txt +0 -0
  230. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/WHEEL +0 -0
  231. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/entry_points.txt +0 -0
  232. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.1.dist-info}/top_level.txt +0 -0
@@ -190,7 +190,7 @@ class CodeObjectSpec(object):
190
190
  return self.co_name
191
191
 
192
192
  def getCodeObjectQualname(self):
193
- return self.co_name
193
+ return self.co_qualname
194
194
 
195
195
  def hasStarListArg(self):
196
196
  return self.co_has_starlist
@@ -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"
@@ -5,7 +5,6 @@
5
5
 
6
6
  """
7
7
 
8
-
9
8
  from .HardImportNodesGenerated import (
10
9
  ExpressionCtypesCdllBefore38CallBase,
11
10
  ExpressionCtypesCdllSince38CallBase,
@@ -8,7 +8,6 @@ that is the child of the dictionary creation.
8
8
 
9
9
  """
10
10
 
11
-
12
11
  from nuitka import Constants
13
12
  from nuitka.specs.BuiltinDictOperationSpecs import dict_fromkeys_spec
14
13
  from nuitka.specs.BuiltinParameterSpecs import extractBuiltinArgs
@@ -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
 
@@ -446,9 +446,11 @@ class ExpressionBase(NodeBase):
446
446
  trace_collection.onExceptionRaiseExit(BaseException)
447
447
 
448
448
  return makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue(
449
- template="int() argument must be a string or a number, not '%s'"
450
- if python_version < 0x300
451
- else "int() argument must be a string, a bytes-like object or a number, not '%s'",
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
- "float() argument must be a string or a number"
500
- if Options.is_full_compat and python_version < 0x300
501
- else "float() argument must be a string or a number, not '%s'",
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
- "complex() argument must be a string or a number"
554
- if Options.is_full_compat and python_version < 0x300
555
- else "complex() argument must be a string or a number, not '%s'",
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,line-too-long
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 capitalize casefold center clear copy count decode encode endswith expandtabs extend find format formatmap fromkeys get haskey index insert isalnum isalpha isascii isdecimal isdigit isidentifier islower isnumeric isprintable isspace istitle isupper items iteritems iterkeys itervalues join keys ljust lower lstrip maketrans partition pop popitem prepare remove replace reverse rfind rindex rjust rpartition rsplit rstrip setdefault sort split splitlines startswith strip swapcase title translate update upper values viewitems viewkeys viewvalues zfill
16
- spell-checker: ignore args chars count default delete encoding end errors fillchar index item iterable keepends key kwargs maxsplit new old pairs prefix sep start stop sub suffix table tabsize value width
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": self.subnode_name.makeClone()
287
- if self.subnode_name is not None
288
- else None,
289
- "path": self.subnode_path.makeClone()
290
- if self.subnode_path is not None
291
- else None,
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": self.subnode_prompt.makeClone()
1635
- if self.subnode_prompt is not None
1636
- else None,
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())
@@ -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=change_desc()
810
- if inspect.isfunction(change_desc)
811
- else change_desc,
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()