Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.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 (210) hide show
  1. Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.1.data/scripts/nuitka-run.cmd +1 -1
  2. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/METADATA +1 -1
  3. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/RECORD +210 -207
  4. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/WHEEL +1 -1
  5. nuitka/CacheCleanup.py +6 -1
  6. nuitka/HardImportRegistry.py +29 -2
  7. nuitka/MainControl.py +62 -35
  8. nuitka/ModuleRegistry.py +11 -3
  9. nuitka/OptionParsing.py +78 -39
  10. nuitka/Options.py +142 -35
  11. nuitka/OutputDirectories.py +5 -0
  12. nuitka/PostProcessing.py +23 -14
  13. nuitka/PythonFlavors.py +22 -4
  14. nuitka/PythonVersions.py +18 -0
  15. nuitka/TreeXML.py +6 -3
  16. nuitka/Version.py +1 -1
  17. nuitka/__main__.py +55 -10
  18. nuitka/build/Backend.scons +6 -1
  19. nuitka/build/CCompilerVersion.scons +1 -0
  20. nuitka/build/Onefile.scons +4 -0
  21. nuitka/build/SconsCaching.py +1 -0
  22. nuitka/build/SconsCompilerSettings.py +1 -0
  23. nuitka/build/SconsHacks.py +5 -1
  24. nuitka/build/SconsInterface.py +2 -0
  25. nuitka/build/SconsUtils.py +4 -1
  26. nuitka/build/include/nuitka/allocator.h +27 -5
  27. nuitka/build/include/nuitka/calling.h +1 -1
  28. nuitka/build/include/nuitka/compiled_frame.h +23 -23
  29. nuitka/build/include/nuitka/compiled_method.h +1 -1
  30. nuitka/build/include/nuitka/exception_groups.h +0 -2
  31. nuitka/build/include/nuitka/helper/attributes.h +7 -1
  32. nuitka/build/include/nuitka/helper/subscripts.h +1 -1
  33. nuitka/build/include/nuitka/helpers.h +7 -4
  34. nuitka/build/include/nuitka/prelude.h +6 -10
  35. nuitka/build/include/nuitka/printing.h +2 -0
  36. nuitka/build/include/nuitka/unfreezing.h +5 -5
  37. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  38. nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
  39. nuitka/build/static_src/CompiledCellType.c +7 -7
  40. nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
  41. nuitka/build/static_src/CompiledCoroutineType.c +2 -4
  42. nuitka/build/static_src/CompiledFrameType.c +109 -82
  43. nuitka/build/static_src/CompiledFunctionType.c +36 -9
  44. nuitka/build/static_src/CompiledGeneratorType.c +12 -10
  45. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
  46. nuitka/build/static_src/CompiledMethodType.c +14 -13
  47. nuitka/build/static_src/HelpersAttributes.c +13 -15
  48. nuitka/build/static_src/HelpersBuiltin.c +16 -7
  49. nuitka/build/static_src/HelpersCalling.c +13 -13
  50. nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
  51. nuitka/build/static_src/HelpersComparisonEq.c +110 -110
  52. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
  53. nuitka/build/static_src/HelpersComparisonGe.c +110 -110
  54. nuitka/build/static_src/HelpersComparisonGt.c +110 -110
  55. nuitka/build/static_src/HelpersComparisonLe.c +110 -110
  56. nuitka/build/static_src/HelpersComparisonLt.c +110 -110
  57. nuitka/build/static_src/HelpersComparisonNe.c +110 -110
  58. nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
  59. nuitka/build/static_src/HelpersDictionaries.c +9 -0
  60. nuitka/build/static_src/HelpersFiles.c +2 -2
  61. nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
  62. nuitka/build/static_src/HelpersImport.c +1 -1
  63. nuitka/build/static_src/HelpersLists.c +5 -1
  64. nuitka/build/static_src/HelpersMatching.c +95 -35
  65. nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
  66. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
  67. nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
  68. nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
  69. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
  70. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
  71. nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
  72. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  73. nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
  74. nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
  75. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
  76. nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
  77. nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
  78. nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
  79. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
  80. nuitka/build/static_src/HelpersSequences.c +1 -1
  81. nuitka/build/static_src/HelpersTypes.c +8 -4
  82. nuitka/build/static_src/MainProgram.c +28 -9
  83. nuitka/build/static_src/MetaPathBasedLoader.c +124 -108
  84. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
  85. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +1 -1
  86. nuitka/build/static_src/OnefileBootstrap.c +34 -6
  87. nuitka/code_generation/AttributeCodes.py +12 -10
  88. nuitka/code_generation/CodeGeneration.py +6 -7
  89. nuitka/code_generation/ConstantCodes.py +53 -10
  90. nuitka/code_generation/GlobalConstants.py +6 -6
  91. nuitka/code_generation/Indentation.py +3 -4
  92. nuitka/code_generation/LoaderCodes.py +3 -0
  93. nuitka/code_generation/LocalsDictCodes.py +36 -14
  94. nuitka/code_generation/MatchCodes.py +23 -4
  95. nuitka/code_generation/ModuleCodes.py +0 -7
  96. nuitka/code_generation/Namify.py +2 -0
  97. nuitka/code_generation/PackageResourceCodes.py +5 -1
  98. nuitka/code_generation/templates/CodeTemplatesConstants.py +6 -4
  99. nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
  100. nuitka/code_generation/templates/CodeTemplatesModules.py +3 -3
  101. nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
  102. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
  103. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
  104. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  105. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
  106. nuitka/freezer/DependsExe.py +3 -1
  107. nuitka/freezer/DllDependenciesMacOS.py +5 -12
  108. nuitka/freezer/IncludedDataFiles.py +12 -3
  109. nuitka/freezer/IncludedEntryPoints.py +8 -2
  110. nuitka/freezer/Onefile.py +6 -1
  111. nuitka/freezer/Standalone.py +9 -2
  112. nuitka/importing/Importing.py +14 -5
  113. nuitka/importing/Recursion.py +3 -0
  114. nuitka/nodes/AttributeNodesGenerated.py +21 -12
  115. nuitka/nodes/BuiltinOpenNodes.py +5 -0
  116. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
  117. nuitka/nodes/BuiltinRefNodes.py +41 -1
  118. nuitka/nodes/ChildrenHavingMixins.py +143 -355
  119. nuitka/nodes/ClassNodes.py +30 -12
  120. nuitka/nodes/CodeObjectSpecs.py +9 -0
  121. nuitka/nodes/ExpressionBasesGenerated.py +11 -11
  122. nuitka/nodes/FunctionNodes.py +7 -11
  123. nuitka/nodes/FutureSpecs.py +16 -3
  124. nuitka/nodes/GeneratorNodes.py +2 -2
  125. nuitka/nodes/HardImportNodesGenerated.py +11 -134
  126. nuitka/nodes/LocalsScopes.py +19 -23
  127. nuitka/nodes/MatchNodes.py +18 -7
  128. nuitka/nodes/ModuleAttributeNodes.py +1 -20
  129. nuitka/nodes/ModuleNodes.py +23 -6
  130. nuitka/nodes/NodeBases.py +3 -2
  131. nuitka/nodes/NodeMetaClasses.py +26 -10
  132. nuitka/nodes/ReturnNodes.py +1 -1
  133. nuitka/nodes/StatementBasesGenerated.py +11 -11
  134. nuitka/nodes/SubscriptNodes.py +4 -4
  135. nuitka/nodes/VariableAssignNodes.py +1 -1
  136. nuitka/nodes/VariableRefNodes.py +28 -2
  137. nuitka/optimizations/FunctionInlining.py +3 -6
  138. nuitka/optimizations/Optimization.py +13 -12
  139. nuitka/optimizations/TraceCollections.py +19 -4
  140. nuitka/plugins/PluginBase.py +121 -133
  141. nuitka/plugins/Plugins.py +91 -3
  142. nuitka/plugins/YamlPluginBase.py +121 -0
  143. nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
  144. nuitka/plugins/standard/DataFilesPlugin.py +15 -6
  145. nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
  146. nuitka/plugins/standard/DllFilesPlugin.py +5 -3
  147. nuitka/plugins/standard/ImplicitImports.py +34 -20
  148. nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
  149. nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
  150. nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
  151. nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
  152. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  153. nuitka/plugins/standard/standard.nuitka-package.config.yml +462 -179
  154. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
  155. nuitka/reports/Reports.py +53 -5
  156. nuitka/specs/BuiltinParameterSpecs.py +1 -1
  157. nuitka/specs/HardImportSpecs.py +0 -6
  158. nuitka/tools/data_composer/DataComposer.py +29 -27
  159. nuitka/tools/environments/CreateEnvironment.py +1 -0
  160. nuitka/tools/environments/Virtualenv.py +25 -11
  161. nuitka/tools/general/find_module/FindModuleCode.py +13 -3
  162. nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
  163. nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
  164. nuitka/tools/specialize/CTypeDescriptions.py +13 -7
  165. nuitka/tools/specialize/SpecializePython.py +18 -1
  166. nuitka/tools/testing/Common.py +19 -6
  167. nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
  168. nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
  169. nuitka/tools/watch/AutoStage.py +144 -0
  170. nuitka/tools/watch/__main__.py +79 -32
  171. nuitka/tree/Building.py +105 -104
  172. nuitka/tree/ComplexCallHelperFunctions.py +16 -26
  173. nuitka/tree/InternalModule.py +8 -0
  174. nuitka/tree/ReformulationAssignmentStatements.py +29 -59
  175. nuitka/tree/ReformulationClasses.py +10 -17
  176. nuitka/tree/ReformulationClasses3.py +69 -43
  177. nuitka/tree/ReformulationComparisonExpressions.py +6 -16
  178. nuitka/tree/ReformulationContractionExpressions.py +14 -23
  179. nuitka/tree/ReformulationDictionaryCreation.py +6 -10
  180. nuitka/tree/ReformulationExecStatements.py +10 -10
  181. nuitka/tree/ReformulationForLoopStatements.py +6 -12
  182. nuitka/tree/ReformulationFunctionStatements.py +21 -28
  183. nuitka/tree/ReformulationImportStatements.py +8 -10
  184. nuitka/tree/ReformulationLambdaExpressions.py +3 -6
  185. nuitka/tree/ReformulationMatchStatements.py +166 -60
  186. nuitka/tree/ReformulationMultidist.py +3 -1
  187. nuitka/tree/ReformulationNamespacePackages.py +1 -1
  188. nuitka/tree/ReformulationPrintStatements.py +3 -6
  189. nuitka/tree/ReformulationSequenceCreation.py +13 -26
  190. nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
  191. nuitka/tree/ReformulationWithStatements.py +12 -16
  192. nuitka/tree/SourceHandling.py +13 -8
  193. nuitka/tree/VariableClosure.py +5 -21
  194. nuitka/utils/Distributions.py +80 -11
  195. nuitka/utils/Download.py +38 -31
  196. nuitka/utils/Execution.py +13 -2
  197. nuitka/utils/FileOperations.py +55 -28
  198. nuitka/utils/Images.py +6 -1
  199. nuitka/utils/Importing.py +1 -1
  200. nuitka/utils/ModuleNames.py +11 -5
  201. nuitka/utils/ReExecute.py +17 -13
  202. nuitka/utils/SharedLibraries.py +32 -8
  203. nuitka/utils/Signing.py +3 -1
  204. nuitka/utils/StaticLibraries.py +51 -41
  205. nuitka/utils/Timing.py +1 -1
  206. nuitka/utils/Utils.py +29 -7
  207. /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.1.data/scripts/nuitka.cmd +0 -0
  208. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/LICENSE.txt +0 -0
  209. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/entry_points.txt +0 -0
  210. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.1.dist-info}/top_level.txt +0 -0
@@ -25,6 +25,7 @@ from nuitka.utils.SharedLibraries import (
25
25
  callInstallNameTool,
26
26
  getOtoolDependencyOutput,
27
27
  getOtoolListing,
28
+ parseOtoolListingOutput,
28
29
  )
29
30
  from nuitka.utils.Utils import getArchitecture
30
31
 
@@ -109,17 +110,9 @@ def detectBinaryPathDLLsMacOS(
109
110
 
110
111
 
111
112
  def _parseOtoolListingOutput(output):
112
- paths = OrderedSet()
113
-
114
- for line in output.split(b"\n")[1:]:
115
- if str is not bytes:
116
- line = line.decode("utf8")
117
-
118
- if not line:
119
- continue
120
-
121
- filename = line.split(" (", 1)[0].strip()
113
+ result = OrderedSet()
122
114
 
115
+ for filename in parseOtoolListingOutput(output):
123
116
  # Ignore dependency from system paths.
124
117
  if not isFilenameBelowPath(
125
118
  path=(
@@ -129,9 +122,9 @@ def _parseOtoolListingOutput(output):
129
122
  ),
130
123
  filename=filename,
131
124
  ):
132
- paths.add(filename)
125
+ result.add(filename)
133
126
 
134
- return paths
127
+ return result
135
128
 
136
129
 
137
130
  def _getNonVersionedDllFilenames2(filename):
@@ -26,7 +26,7 @@ from nuitka.Options import (
26
26
  shallMakeModule,
27
27
  )
28
28
  from nuitka.OutputDirectories import getStandaloneDirectoryPath
29
- from nuitka.Tracing import options_logger
29
+ from nuitka.Tracing import general, options_logger
30
30
  from nuitka.utils.FileOperations import (
31
31
  areSamePaths,
32
32
  containsPathElements,
@@ -36,6 +36,7 @@ from nuitka.utils.FileOperations import (
36
36
  getFilenameExtension,
37
37
  getFileSize,
38
38
  isFilenameBelowPath,
39
+ isLegalPath,
39
40
  isRelativePath,
40
41
  makePath,
41
42
  openTextFile,
@@ -98,6 +99,14 @@ class IncludedDataFile(object):
98
99
  self.kind = kind
99
100
  self.source_path = source_path
100
101
  self.dest_path = os.path.normpath(dest_path)
102
+
103
+ is_legal, illegal_reason = isLegalPath(dest_path)
104
+ if not is_legal:
105
+ general.sysexit(
106
+ "Error, cannot add data file with '%s' path, as '%s'"
107
+ % (dest_path, illegal_reason)
108
+ )
109
+
101
110
  self.reason = reason
102
111
  self.data = data
103
112
  self.tags = tags_set
@@ -159,8 +168,8 @@ def makeIncludedDataFile(source_path, dest_path, reason, tracer, tags):
159
168
  if isAcceleratedMode():
160
169
  if "package_data" not in tags and not areSamePaths(source_path, dest_path):
161
170
  tracer.sysexit(
162
- "Error, cannot change paths for data files in accelerated mode '%s'."
163
- % dest_path
171
+ "Error, cannot change paths for data files in accelerated mode from '%s' to '%s'."
172
+ % (source_path, dest_path)
164
173
  )
165
174
  else:
166
175
  inside = True
@@ -315,12 +315,18 @@ def setMainEntryPoint(binary_filename):
315
315
 
316
316
 
317
317
  def addExtensionModuleEntryPoint(module):
318
+ dest_path = module.getFullName().asPath()
319
+
320
+ if module.isExtensionModulePackage():
321
+ dest_path = os.path.join(dest_path, "__init__")
322
+
323
+ dest_path += getSharedLibrarySuffix(preferred=False)
324
+
318
325
  standalone_entry_points.append(
319
326
  makeExtensionModuleEntryPoint(
320
327
  logger=general,
321
328
  source_path=module.getFilename(),
322
- dest_path=module.getFullName().asPath()
323
- + getSharedLibrarySuffix(preferred=False),
329
+ dest_path=dest_path,
324
330
  module_name=module.getFullName(),
325
331
  package_name=module.getFullName().getPackageName(),
326
332
  reason=(
nuitka/freezer/Onefile.py CHANGED
@@ -270,7 +270,12 @@ def packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir):
270
270
  if Options.isRemoveBuildDir():
271
271
  onefile_logger.info("Removing onefile build directory '%s'." % source_dir)
272
272
 
273
- removeDirectory(path=source_dir, ignore_errors=False)
273
+ removeDirectory(
274
+ path=source_dir,
275
+ logger=onefile_logger,
276
+ ignore_errors=False,
277
+ extra_recommendation=None,
278
+ )
274
279
  assert not os.path.exists(source_dir)
275
280
  else:
276
281
  onefile_logger.info("Keeping onefile build directory '%s'." % source_dir)
@@ -28,7 +28,11 @@ from nuitka.Progress import (
28
28
  reportProgressBar,
29
29
  setupProgressBar,
30
30
  )
31
- from nuitka.PythonFlavors import isAnacondaPython, isHomebrewPython
31
+ from nuitka.PythonFlavors import (
32
+ getHomebrewInstallPath,
33
+ isAnacondaPython,
34
+ isHomebrewPython,
35
+ )
32
36
  from nuitka.PythonVersions import getSystemPrefixPath
33
37
  from nuitka.Tracing import general, inclusion_logger
34
38
  from nuitka.utils.FileOperations import areInSamePaths, isFilenameBelowPath
@@ -226,9 +230,12 @@ def copyDllsUsed(dist_dir, standalone_entry_points):
226
230
  def _reduceToPythonPath(used_dlls):
227
231
  inside_paths = getPythonUnpackedSearchPath()
228
232
 
229
- if isAnacondaPython() or isHomebrewPython():
233
+ if isAnacondaPython():
230
234
  inside_paths.insert(0, getSystemPrefixPath())
231
235
 
236
+ if isHomebrewPython():
237
+ inside_paths.insert(0, getHomebrewInstallPath())
238
+
232
239
  def decideInside(dll_filename):
233
240
  return any(
234
241
  isFilenameBelowPath(path=inside_path, filename=dll_filename)
@@ -49,7 +49,11 @@ from nuitka.utils.ModuleNames import ModuleName
49
49
  from nuitka.utils.SharedLibraries import (
50
50
  hasUniversalOrMatchingMacOSArchitecture,
51
51
  )
52
- from nuitka.utils.Utils import isMacOS, isWin32OrPosixWindows
52
+ from nuitka.utils.Utils import (
53
+ getLaunchingNuitkaProcessEnvironmentValue,
54
+ isMacOS,
55
+ isWin32OrPosixWindows,
56
+ )
53
57
 
54
58
  from .IgnoreListing import isIgnoreListedNotExistingModule
55
59
  from .PreloadedPackages import getPreloadedPackagePath, isPreloadedPackagePath
@@ -185,7 +189,7 @@ def hasMainScriptDirectory():
185
189
  def isPackageDir(dirname):
186
190
  """Decide if a directory is a package.
187
191
 
188
- Before Python3.3 it's required to have a "__init__.py" file, but then
192
+ Before Python3 it's required to have a "__init__.py" file, but then
189
193
  it became impossible to decide, and for extra fun, there is also the
190
194
  extra packages provided via "*.pth" file tricks by "site.py" loading.
191
195
  """
@@ -340,7 +344,7 @@ def findModule(module_name, parent_package, level):
340
344
  # TODO: Should give a warning and return not found if the levels
341
345
  # exceed the package name.
342
346
  if parent_package is not None:
343
- parent_package = parent_package.getRelativePackageName(level)
347
+ parent_package = parent_package.getRelativePackageName(level - 1)
344
348
  else:
345
349
  return None, None, None, "not-found"
346
350
 
@@ -642,7 +646,12 @@ def _unpackPathElement(path_entry):
642
646
  zip_ref.extractall(target_dir)
643
647
  zip_ref.close()
644
648
  except BaseException:
645
- removeDirectory(target_dir, ignore_errors=True)
649
+ removeDirectory(
650
+ target_dir,
651
+ logger=recursion_logger,
652
+ ignore_errors=True,
653
+ extra_recommendation=None,
654
+ )
646
655
  raise
647
656
 
648
657
  _egg_files[path_entry] = target_dir
@@ -719,7 +728,7 @@ def _findModuleInPath(module_name):
719
728
  # executed, while we normally search in PYTHONPATH after it was executed,
720
729
  # and on some systems, that fails.
721
730
  if package_name is None and module_name == "site":
722
- candidate = os.getenv("NUITKA_SITE_FILENAME")
731
+ candidate = getLaunchingNuitkaProcessEnvironmentValue("NUITKA_SITE_FILENAME")
723
732
 
724
733
  if candidate:
725
734
  return candidate, "py"
@@ -154,6 +154,9 @@ def _decideRecursion(
154
154
  if module_name == "__main__":
155
155
  return False, "Main program is not followed to a second time."
156
156
 
157
+ if using_module_name == "__main__" and Options.isMultidistMode():
158
+ return True, "Main program multidist entry points."
159
+
157
160
  if module_kind == "extension" and not Options.isStandaloneMode():
158
161
  return False, "Extension modules cannot be inspected."
159
162
 
@@ -10,18 +10,18 @@
10
10
 
11
11
  WARNING, this code is GENERATED. Modify the template AttributeNodeFixed.py.j2 instead!
12
12
 
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
13
+ spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
14
+ spell-checker: ignore clear copy count decode default delete dist distribution_name encode
15
+ spell-checker: ignore encoding end endswith errors exit_code expandtabs
16
+ spell-checker: ignore experimental_attributes experimental_autograph_options
17
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
18
+ spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
19
+ spell-checker: ignore find format format_map formatmap fromkeys func get group handle
20
+ spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
21
+ spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
22
+ spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
23
+ spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
24
+ spell-checker: ignore maketrans maxsplit mode name new old p package
25
25
  spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
26
26
  spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
27
27
  spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
@@ -32,6 +32,7 @@ spell-checker: ignore winmode zfill
32
32
  """
33
33
 
34
34
 
35
+ from nuitka.PythonVersions import getDictFromkeysNoArgErrorMessage
35
36
  from nuitka.specs.BuiltinBytesOperationSpecs import (
36
37
  bytes_capitalize_spec,
37
38
  bytes_center_spec,
@@ -260,7 +261,10 @@ from .ListOperationNodes import (
260
261
  ExpressionListOperationReverse,
261
262
  )
262
263
  from .NodeBases import SideEffectsFromChildrenMixin
263
- from .NodeMakingHelpers import wrapExpressionWithNodeSideEffects
264
+ from .NodeMakingHelpers import (
265
+ makeRaiseExceptionReplacementExpression,
266
+ wrapExpressionWithNodeSideEffects,
267
+ )
264
268
  from .StrNodes import (
265
269
  ExpressionStrOperationCapitalize,
266
270
  ExpressionStrOperationCenter2,
@@ -2857,6 +2861,11 @@ class ExpressionAttributeLookupDictFromkeys(
2857
2861
  node=call_node,
2858
2862
  builtin_class=wrapExpressionDictOperationFromkeys,
2859
2863
  builtin_spec=dict_fromkeys_spec,
2864
+ empty_special_class=lambda source_ref: makeRaiseExceptionReplacementExpression(
2865
+ expression=dict_arg,
2866
+ exception_type="TypeError",
2867
+ exception_value=getDictFromkeysNoArgErrorMessage(),
2868
+ ),
2860
2869
  )
2861
2870
 
2862
2871
  result = wrapExpressionWithNodeSideEffects(old_node=dict_arg, new_node=result)
@@ -7,6 +7,7 @@ This is a rather two sided beast, as it may be read or write. And we would like
7
7
  to track it, so we can include files into the executable, or write more efficiently.
8
8
  """
9
9
 
10
+ from .BuiltinRefNodes import ExpressionBuiltinPatchableTypeRef
10
11
  from .ChildrenHavingMixins import (
11
12
  ChildrenExpressionBuiltinOpenP2Mixin,
12
13
  ChildrenExpressionBuiltinOpenP3Mixin,
@@ -127,6 +128,10 @@ def makeExpressionBuiltinsOpenCall(
127
128
  )
128
129
 
129
130
 
131
+ def makeBuiltinOpenRefNode(source_ref):
132
+ return ExpressionBuiltinPatchableTypeRef(builtin_name="open", source_ref=source_ref)
133
+
134
+
130
135
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
131
136
  # integrates with CPython, but also works on its own.
132
137
  #
@@ -10,18 +10,18 @@
10
10
 
11
11
  WARNING, this code is GENERATED. Modify the template BuiltinOperationNodeBases.py.j2 instead!
12
12
 
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
13
+ spell-checker: ignore __prepare__ append args autograph capitalize casefold center chars
14
+ spell-checker: ignore clear copy count decode default delete dist distribution_name encode
15
+ spell-checker: ignore encoding end endswith errors exit_code expandtabs
16
+ spell-checker: ignore experimental_attributes experimental_autograph_options
17
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
18
+ spell-checker: ignore experimental_implements experimental_relax_shapes extend fillchar
19
+ spell-checker: ignore find format format_map formatmap fromkeys func get group handle
20
+ spell-checker: ignore has_key haskey index input_signature insert isalnum isalpha isascii
21
+ spell-checker: ignore isdecimal isdigit isidentifier islower isnumeric isprintable isspace
22
+ spell-checker: ignore istitle isupper item items iterable iteritems iterkeys itervalues
23
+ spell-checker: ignore jit_compile join keepends key keys kwargs ljust lower lstrip
24
+ spell-checker: ignore maketrans maxsplit mode name new old p package
25
25
  spell-checker: ignore package_or_requirement pairs partition path pop popitem prefix
26
26
  spell-checker: ignore prepare reduce_retracing remove replace resource resource_name
27
27
  spell-checker: ignore reverse rfind rindex rjust rpartition rsplit rstrip s sep setdefault
@@ -27,7 +27,11 @@ from .ExceptionNodes import (
27
27
  ExpressionBuiltinMakeExceptionImportError,
28
28
  ExpressionBuiltinMakeExceptionModuleNotFoundError,
29
29
  )
30
- from .ExpressionBases import CompileTimeConstantExpressionBase
30
+ from .ExpressionBases import (
31
+ CompileTimeConstantExpressionBase,
32
+ ExpressionBase,
33
+ ExpressionNoSideEffectsMixin,
34
+ )
31
35
  from .shapes.BuiltinTypeShapes import tshape_exception_class
32
36
 
33
37
 
@@ -68,6 +72,42 @@ def makeExpressionBuiltinTypeRef(builtin_name, source_ref):
68
72
  )
69
73
 
70
74
 
75
+ class ExpressionBuiltinPatchableTypeRef(ExpressionNoSideEffectsMixin, ExpressionBase):
76
+ kind = "EXPRESSION_BUILTIN_PATCHABLE_TYPE_REF"
77
+
78
+ __slots__ = ("builtin_name",)
79
+
80
+ def __init__(self, builtin_name, source_ref):
81
+ ExpressionBase.__init__(self, source_ref=source_ref)
82
+
83
+ self.builtin_name = builtin_name
84
+
85
+ def finalize(self):
86
+ del self.parent
87
+
88
+ def computeExpressionRaw(self, trace_collection):
89
+ if self.parent.isExpressionCall():
90
+ result = makeExpressionBuiltinTypeRef(
91
+ builtin_name=self.builtin_name, source_ref=self.source_ref
92
+ )
93
+
94
+ return (
95
+ result,
96
+ "new_expression",
97
+ "Treat 'builtins.%s' in call as built value reference."
98
+ % self.builtin_name,
99
+ )
100
+
101
+ return self, None, None
102
+
103
+ @staticmethod
104
+ def getModuleName():
105
+ return "builtins"
106
+
107
+ def getImportName(self):
108
+ return self.builtin_name
109
+
110
+
71
111
  quick_names = {"None": None, "True": True, "False": False}
72
112
 
73
113