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
@@ -156,6 +156,9 @@ deployment_mode = getArgumentBool("deployment", False)
156
156
  # Experimental indications. Do things that are not yet safe to do.
157
157
  no_deployment = getArgumentList("no_deployment", "")
158
158
 
159
+ # Debug mode indications. Do check things with fine granularity.
160
+ debug_modes = getArgumentList("debug_modes", "")
161
+
159
162
  # Tracing mode. Output program progress.
160
163
  trace_mode = getArgumentBool("trace_mode", False)
161
164
 
@@ -315,6 +318,7 @@ env = createEnvironment(
315
318
  target_arch=target_arch,
316
319
  experimental=experimental,
317
320
  no_deployment=no_deployment,
321
+ debug_modes=debug_modes,
318
322
  )
319
323
 
320
324
  scons_details_logger.info("Initial CC: %r" % env.get("CC"))
@@ -797,7 +801,7 @@ env.Append(
797
801
  ]
798
802
  )
799
803
 
800
- if env.standalone_mode and env.debian_python and python_version >= (3, 12):
804
+ if env.debian_python and python_version >= (3, 12):
801
805
  env.Append(
802
806
  CPPPATH=[
803
807
  os.path.join(env.nuitka_src, "inline_copy", "python_hacl", "hacl_312"),
@@ -806,6 +810,7 @@ if env.standalone_mode and env.debian_python and python_version >= (3, 12):
806
810
  ),
807
811
  ]
808
812
  )
813
+
809
814
  env.Append(CPPDEFINES=["_NUITKA_INLINE_COPY_HACL"])
810
815
 
811
816
  # Set load libpython from binary directory default
@@ -171,6 +171,7 @@ env = createEnvironment(
171
171
  target_arch=target_arch,
172
172
  experimental=experimental,
173
173
  no_deployment=(),
174
+ debug_modes=(),
174
175
  )
175
176
 
176
177
  scons_details_logger.info("Initial CC: %r" % env.get("CC"))
@@ -116,6 +116,9 @@ deployment_mode = getArgumentBool("deployment", False)
116
116
  # Experimental indications. Do things that are not yet safe to do.
117
117
  no_deployment = getArgumentList("no_deployment", "")
118
118
 
119
+ # Debug mode indications. Do check things with fine granularity.
120
+ debug_modes = getArgumentList("debug_modes", "")
121
+
119
122
  # Experimental indications. Do things that are not yet safe to do.
120
123
  experimental = getArgumentList("experimental", "")
121
124
 
@@ -228,6 +231,7 @@ env = createEnvironment(
228
231
  target_arch=target_arch,
229
232
  experimental=experimental,
230
233
  no_deployment=no_deployment,
234
+ debug_modes=debug_modes,
231
235
  )
232
236
 
233
237
  scons_details_logger.info("Initial CC: %r" % env.get("CC"))
@@ -92,6 +92,7 @@ def _injectCcache(env, cc_path, python_prefix, assume_yes_for_downloads):
92
92
  url=url,
93
93
  is_arch_specific=False,
94
94
  specificity=url.rsplit("/", 2)[1],
95
+ unzip=True,
95
96
  flatten=True,
96
97
  binary="ccache",
97
98
  message="Nuitka will make use of ccache to speed up repeated compilation.",
@@ -404,6 +404,7 @@ For Python version %s MSVC %s or later is required, not %s which is too old."""
404
404
  target_arch=target_arch,
405
405
  experimental=env.experimental_flags,
406
406
  no_deployment=env.no_deployment_flags,
407
+ debug_modes=env.debug_modes_flags,
407
408
  )
408
409
 
409
410
  if clang_mode:
@@ -142,7 +142,11 @@ def myDetect(self, progs):
142
142
  return None
143
143
 
144
144
  # Note: Actually, with our inline copy, this is maybe not supposed to
145
- # happen at all
145
+ # happen a lot at all. It's a bit hard to pass debug flag to here, or
146
+ # else we could assert it.
147
+ # for p in progs:
148
+ # if p not in ("x86_64-conda-linux-gnu-gcc", "gcc", "cc", "g++"):
149
+ # assert False, p
146
150
 
147
151
  return orig_detect(self, progs)
148
152
 
@@ -469,6 +469,8 @@ def setCommonSconsOptions(options):
469
469
 
470
470
  options["experimental"] = ",".join(Options.getExperimentalIndications())
471
471
 
472
+ options["debug_modes"] = ",".join(Options.getDebugModeIndications())
473
+
472
474
  options["no_deployment"] = ",".join(Options.getNoDeploymentIndications())
473
475
 
474
476
  if Options.shallRunInDebugger():
@@ -173,7 +173,7 @@ def prepareEnvironment(mingw_mode):
173
173
 
174
174
 
175
175
  def createEnvironment(
176
- mingw_mode, msvc_version, target_arch, experimental, no_deployment
176
+ mingw_mode, msvc_version, target_arch, experimental, no_deployment, debug_modes
177
177
  ):
178
178
  from SCons.Script import Environment # pylint: disable=I0021,import-error
179
179
 
@@ -271,6 +271,9 @@ def createEnvironment(
271
271
  _enableFlagSettings(env, "experimental", experimental)
272
272
  env.experimental_flags = experimental
273
273
 
274
+ _enableFlagSettings(env, "debug", debug_modes)
275
+ env.debug_modes_flags = debug_modes
276
+
274
277
  return env
275
278
 
276
279
 
@@ -108,12 +108,12 @@ static inline void _Nuitka_Py_XDECREF(PyObject *ob) {
108
108
  #if PYTHON_VERSION < 0x3c0
109
109
  #define Py_INCREF_IMMORTAL(value) Py_INCREF(value)
110
110
  #define Py_DECREF_IMMORTAL(value) Py_DECREF(value)
111
- #elif defined(__NUITKA_NO_ASSERT__)
112
- #define Py_INCREF_IMMORTAL(value)
113
- #define Py_DECREF_IMMORTAL(value)
114
- #else
111
+ #elif defined(_NUITKA_DEBUG_DEBUG_IMMORTAL)
115
112
  #define Py_INCREF_IMMORTAL(value) assert(Py_REFCNT(value) == _Py_IMMORTAL_REFCNT)
116
113
  #define Py_DECREF_IMMORTAL(value) assert(Py_REFCNT(value) == _Py_IMMORTAL_REFCNT)
114
+ #else
115
+ #define Py_INCREF_IMMORTAL(value)
116
+ #define Py_DECREF_IMMORTAL(value)
117
117
  #endif
118
118
 
119
119
  // Macro introduced with Python3.9 or higher, make it generally available.
@@ -134,7 +134,16 @@ static inline void Nuitka_Py_NewReference(PyObject *op) {
134
134
  _PyInterpreterState_GET()->object_state.reftotal++;
135
135
  #endif
136
136
  #endif
137
+ #if !defined(Py_GIL_DISABLED)
137
138
  op->ob_refcnt = 1;
139
+ #else
140
+ op->ob_tid = _Py_ThreadId();
141
+ op->_padding = 0;
142
+ op->ob_mutex = (struct _PyMutex){0};
143
+ op->ob_gc_bits = 0;
144
+ op->ob_ref_local = 1;
145
+ op->ob_ref_shared = 0;
146
+ #endif
138
147
  }
139
148
  #else
140
149
  #define Nuitka_Py_NewReference(op) _Py_NewReference(op)
@@ -280,7 +289,20 @@ static bool inline Nuitka_GC_IS_TRACKED_X(PyObject *object) {
280
289
 
281
290
  // To allow us marking some of our own values as immortal.
282
291
  #if PYTHON_VERSION >= 0x3c0
283
- static void inline Py_SET_REFCNT_IMMORTAL(PyObject *object) { object->ob_refcnt = _Py_IMMORTAL_REFCNT; }
292
+ static void inline Py_SET_REFCNT_IMMORTAL(PyObject *object) {
293
+ // Normally done only with 3.13, but it makes sense to do this.
294
+ if (_PyObject_IS_GC(object) && _PyObject_GC_IS_TRACKED(object)) {
295
+ Nuitka_GC_UnTrack(object);
296
+ }
297
+
298
+ #ifdef Py_GIL_DISABLED
299
+ object->ob_tid = _Py_UNOWNED_TID;
300
+ object->ob_ref_local = _Py_IMMORTAL_REFCNT_LOCAL;
301
+ object->ob_ref_shared = 0;
302
+ #else
303
+ object->ob_refcnt = _Py_IMMORTAL_REFCNT;
304
+ #endif
305
+ }
284
306
  #else
285
307
  #define Py_SET_REFCNT_IMMORTAL(object)
286
308
  #endif
@@ -11,7 +11,7 @@
11
11
  // For exception test formatting and call code mostly.
12
12
  extern char const *GET_CALLABLE_NAME(PyObject *object);
13
13
  extern char const *GET_CALLABLE_DESC(PyObject *object);
14
- extern char const *GET_CLASS_NAME(PyObject *klass);
14
+ extern char const *GET_CLASS_NAME(PyObject *class_object);
15
15
  extern char const *GET_INSTANCE_CLASS_NAME(PyThreadState *tstate, PyObject *instance);
16
16
 
17
17
  // Also used in generated helper code.
@@ -47,44 +47,44 @@ extern struct Nuitka_FrameObject *MAKE_CLASS_FRAME(PyThreadState *tstate, PyCode
47
47
  // Create a code object for the given filename and function name
48
48
 
49
49
  #if PYTHON_VERSION < 0x300
50
- #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count, \
50
+ #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
51
51
  kw_only_count, pos_only_count) \
52
- makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count)
52
+ makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count)
53
53
  extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
54
- PyObject *argnames, PyObject *freevars, int arg_count);
54
+ PyObject *arg_names, PyObject *free_vars, int arg_count);
55
55
  #elif PYTHON_VERSION < 0x380
56
- #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count, \
56
+ #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
57
57
  kw_only_count, pos_only_count) \
58
- makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count, kw_only_count)
58
+ makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count, kw_only_count)
59
59
  extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
60
- PyObject *argnames, PyObject *freevars, int arg_count, int kw_only_count);
60
+ PyObject *arg_names, PyObject *free_vars, int arg_count, int kw_only_count);
61
61
  #elif PYTHON_VERSION < 0x3b0
62
- #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count, \
62
+ #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
63
63
  kw_only_count, pos_only_count) \
64
- makeCodeObject(filename, line, flags, function_name, argnames, freevars, arg_count, kw_only_count, pos_only_count)
64
+ makeCodeObject(filename, line, flags, function_name, arg_names, free_vars, arg_count, kw_only_count, pos_only_count)
65
65
  extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
66
- PyObject *argnames, PyObject *freevars, int arg_count, int kw_only_count,
66
+ PyObject *arg_names, PyObject *free_vars, int arg_count, int kw_only_count,
67
67
  int pos_only_count);
68
68
  #else
69
- #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count, \
69
+ #define MAKE_CODE_OBJECT(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
70
70
  kw_only_count, pos_only_count) \
71
- makeCodeObject(filename, line, flags, function_name, function_qualname, argnames, freevars, arg_count, \
71
+ makeCodeObject(filename, line, flags, function_name, function_qualname, arg_names, free_vars, arg_count, \
72
72
  kw_only_count, pos_only_count)
73
73
  extern PyCodeObject *makeCodeObject(PyObject *filename, int line, int flags, PyObject *function_name,
74
- PyObject *function_qualname, PyObject *argnames, PyObject *freevars, int arg_count,
75
- int kw_only_count, int pos_only_count);
74
+ PyObject *function_qualname, PyObject *arg_names, PyObject *free_vars,
75
+ int arg_count, int kw_only_count, int pos_only_count);
76
76
  #endif
77
77
 
78
78
  NUITKA_MAY_BE_UNUSED static inline bool isFakeCodeObject(PyCodeObject *code) {
79
79
  #if PYTHON_VERSION < 0x300
80
80
  return code->co_code == const_str_empty;
81
81
  #elif PYTHON_VERSION < 0x3b0
82
- return code->co_code == const_str_empty;
83
- #elif PYTHON_VERSION < 0x3c0
84
- return _PyCode_CODE(code)[0] == 0;
82
+ return code->co_code == const_bytes_empty;
85
83
  #else
86
- _Py_CODEUNIT *code_unit = _PyCode_CODE(code);
87
- return code_unit->op.code == 0;
84
+ // Starting for Python3.11, we just proper bytecode that raises
85
+ // "RuntimeError" itself, so this function is only used to
86
+ // optimize checks away.
87
+ return false;
88
88
  #endif
89
89
  }
90
90
 
@@ -221,11 +221,11 @@ inline static void assertThreadFrameObject(Nuitka_ThreadStateFrameType *frame) {
221
221
  #endif
222
222
  }
223
223
 
224
- // Mark frame as currently executed. Starting with Python 3.4 that means it
224
+ // Mark frame as currently executed. Starting with Python 3 that means it
225
225
  // can or cannot be cleared, or should lead to a generator close. For Python2
226
226
  // this is a no-op. Using a define to spare the compile from inlining an empty
227
227
  // function.
228
- #if PYTHON_VERSION >= 0x340
228
+ #if PYTHON_VERSION >= 0x300
229
229
 
230
230
  #if PYTHON_VERSION < 0x3b0
231
231
 
@@ -253,7 +253,7 @@ static inline void Nuitka_Frame_MarkAsExecuting(struct Nuitka_FrameObject *frame
253
253
  #define Nuitka_Frame_MarkAsExecuting(frame) ;
254
254
  #endif
255
255
 
256
- #if PYTHON_VERSION >= 0x340
256
+ #if PYTHON_VERSION >= 0x300
257
257
  static inline void Nuitka_Frame_MarkAsNotExecuting(struct Nuitka_FrameObject *frame) {
258
258
  CHECK_OBJECT(frame);
259
259
  #if PYTHON_VERSION >= 0x3b0
@@ -269,7 +269,7 @@ static inline void Nuitka_Frame_MarkAsNotExecuting(struct Nuitka_FrameObject *fr
269
269
  #define Nuitka_PythonFrame_MarkAsExecuting(frame) ;
270
270
  #endif
271
271
 
272
- #if PYTHON_VERSION >= 0x340
272
+ #if PYTHON_VERSION >= 0x300
273
273
  static inline bool Nuitka_Frame_IsExecuting(struct Nuitka_FrameObject *frame) {
274
274
  CHECK_OBJECT(frame);
275
275
  #if PYTHON_VERSION >= 0x3b0
@@ -396,7 +396,7 @@ NUITKA_MAY_BE_UNUSED inline static void popFrameStack(PyThreadState *tstate) {
396
396
 
397
397
  // TODO: These can be moved to private code, once all C library is included by
398
398
  // compiled code helpers, but generators are currently not.
399
- #if PYTHON_VERSION >= 0x340
399
+ #if PYTHON_VERSION >= 0x300
400
400
  NUITKA_MAY_BE_UNUSED static void Nuitka_SetFrameGenerator(struct Nuitka_FrameObject *nuitka_frame,
401
401
  PyObject *generator) {
402
402
  #if PYTHON_VERSION < 0x3b0
@@ -32,7 +32,7 @@ struct Nuitka_MethodObject {
32
32
  extern PyTypeObject Nuitka_Method_Type;
33
33
 
34
34
  // Make a method out of a function.
35
- extern PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *klass);
35
+ extern PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *class_object);
36
36
 
37
37
  static inline bool Nuitka_Method_Check(PyObject *object) { return Py_TYPE(object) == &Nuitka_Method_Type; }
38
38
 
@@ -75,8 +75,6 @@ NUITKA_MAY_BE_UNUSED static int CHECK_EXCEPTION_STAR_VALID(PyThreadState *tstate
75
75
  return 0;
76
76
  }
77
77
 
78
- extern PyObject *const_str_plain_split;
79
-
80
78
  NUITKA_MAY_BE_UNUSED static int EXCEPTION_GROUP_MATCH(PyThreadState *tstate, PyObject *exc_value, PyObject *match_type,
81
79
  PyObject **match, PyObject **rest) {
82
80
  // TODO: Avoid this from happening, we should not call it then.
@@ -35,7 +35,7 @@ extern PyObject *LOOKUP_SPECIAL(PyThreadState *tstate, PyObject *source, PyObjec
35
35
 
36
36
  // Find an attribute in a class, Python2 only.
37
37
  #if PYTHON_VERSION < 0x300
38
- extern PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *klass, PyObject *attr_name);
38
+ extern PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *class_object, PyObject *attr_name);
39
39
  #endif
40
40
 
41
41
  extern PyObject *LOOKUP_MODULE_VALUE(PyDictObject *module_dict, PyObject *var_name);
@@ -70,6 +70,12 @@ static inline bool hasTypeGenericSetAttr(PyTypeObject *type) {
70
70
  #endif
71
71
  }
72
72
 
73
+ #if PYTHON_VERSION >= 0x3a0
74
+ static inline bool Nuitka_Descr_IsData(PyObject *object) { return Py_TYPE(object)->tp_descr_set != NULL; }
75
+ #else
76
+ #define Nuitka_Descr_IsData(object) PyDescr_IsData(object)
77
+ #endif
78
+
73
79
  #endif
74
80
 
75
81
  // Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -238,7 +238,7 @@ NUITKA_MAY_BE_UNUSED static PyObject *LOOKUP_SUBSCRIPT(PyThreadState *tstate, Py
238
238
  #endif
239
239
  }
240
240
 
241
- int MATCH_MAPPING_KEY(PyThreadState *tstate, PyObject *map, PyObject *key);
241
+ bool MATCH_MAPPING_KEY(PyThreadState *tstate, PyObject *map, PyObject *key);
242
242
 
243
243
  NUITKA_MAY_BE_UNUSED static bool SET_SUBSCRIPT_CONST(PyThreadState *tstate, PyObject *target, PyObject *subscript,
244
244
  Py_ssize_t int_subscript, PyObject *value) {
@@ -162,7 +162,7 @@ extern PyObject *BUILTIN_OPEN(PyThreadState *tstate, PyObject *file_name, PyObje
162
162
  // Small helper to open files with few arguments in C.
163
163
  extern PyObject *BUILTIN_OPEN_BINARY_READ_SIMPLE(PyThreadState *tstate, PyObject *filename);
164
164
  extern PyObject *BUILTIN_OPEN_SIMPLE(PyThreadState *tstate, PyObject *filename, char const *mode, bool buffering,
165
- PyObject *encoding);
165
+ PyObject *encoding, bool close_fd);
166
166
 
167
167
  // Small helper to read file contents with few arguments in C.
168
168
  extern PyObject *GET_FILE_BYTES(PyThreadState *tstate, PyObject *filename);
@@ -334,8 +334,8 @@ extern void patchTracebackDealloc(void);
334
334
  // Initialize value for "tp_compare" and "tp_init" defaults.
335
335
  extern void _initSlotCompare(void);
336
336
 
337
- // Default __init__ slot wrapper.
338
- extern python_initproc default_tp_init_wrapper;
337
+ // Default __init__ slot wrapper, spell-checker: ignore initproc
338
+ extern python_init_proc default_tp_init_wrapper;
339
339
 
340
340
  #if PYTHON_VERSION >= 0x300
341
341
  // Select the metaclass from specified one and given bases.
@@ -343,7 +343,8 @@ extern PyObject *SELECT_METACLASS(PyThreadState *tstate, PyObject *metaclass, Py
343
343
  #endif
344
344
 
345
345
  #if PYTHON_VERSION >= 0x3a0
346
- extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, Py_ssize_t max_allowed);
346
+ extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, PyObject *matched_type,
347
+ Py_ssize_t positional_count, PyObject **keywords, Py_ssize_t keywords_count);
347
348
  #endif
348
349
 
349
350
  NUITKA_MAY_BE_UNUSED static PyObject *MODULE_NAME1(PyThreadState *tstate, PyObject *module) {
@@ -413,6 +414,8 @@ extern PyObject *Py_SysVersionInfo;
413
414
 
414
415
  extern PyObject *MAKE_UNION_TYPE(PyObject *args);
415
416
 
417
+ // Our wrapper for "PyType_Ready" that takes care of trying to avoid DLL entry
418
+ // points for generic attributes. spell-checker: ignore aiter
416
419
  extern void Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool generic_get_attr, bool generic_set_attr,
417
420
  bool self_iter, bool await_self_iter, bool self_aiter);
418
421
 
@@ -27,9 +27,10 @@
27
27
 
28
28
  /* This is needed or else we can't create modules name "proc" or "func". For
29
29
  * Python3, the name collision can't happen, so we can limit it to Python2.
30
+ spell-checker: ignore initproc,initfunc
30
31
  */
31
- #define initproc python_initproc
32
- #define initfunc python_initfunc
32
+ #define initproc python_init_proc
33
+ #define initfunc python_init_func
33
34
  #define initstate python_initstate
34
35
 
35
36
  // Python 3.11 headers give these warnings
@@ -251,11 +252,6 @@ NUITKA_MAY_BE_UNUSED static inline managed_static_type_state *Nuitka_PyStaticTyp
251
252
  #define NUITKA_DYNAMIC_ARRAY_DECL(VARIABLE_NAME, ELEMENT_TYPE, COUNT) ELEMENT_TYPE VARIABLE_NAME[COUNT];
252
253
  #endif
253
254
 
254
- // Stringizing, to make strings out of defines use XSTRINGIZED(SOME_DEFINE) needs
255
- // to level of defines to work.
256
- #define _STRINGIZED(ARG) #ARG
257
- #define STRINGIZED(ARG) _STRINGIZED(ARG)
258
-
259
255
  /* Python3 removed PyInt instead of renaming PyLong, and PyObject_Str instead
260
256
  * of renaming PyObject_Unicode. Define this to be easily portable.
261
257
  */
@@ -415,9 +411,9 @@ extern PyThreadState *_PyThreadState_Current;
415
411
  #endif
416
412
 
417
413
  #if PYTHON_VERSION < 0x300
418
- #define RICHCOMPARE(t) (PyType_HasFeature((t), Py_TPFLAGS_HAVE_RICHCOMPARE) ? (t)->tp_richcompare : NULL)
414
+ #define TP_RICHCOMPARE(t) (PyType_HasFeature((t), Py_TPFLAGS_HAVE_RICHCOMPARE) ? (t)->tp_richcompare : NULL)
419
415
  #else
420
- #define RICHCOMPARE(t) ((t)->tp_richcompare)
416
+ #define TP_RICHCOMPARE(t) ((t)->tp_richcompare)
421
417
  #endif
422
418
 
423
419
  // For older Python we need to define this ourselves.
@@ -522,7 +518,7 @@ extern PyObject *Nuitka_dunder_compiled_value;
522
518
  #include "nuitka_data_decoder.h"
523
519
  #else
524
520
  #define DECODE(x) assert(x)
525
- #define UNTRANSLATE(x) (x)
521
+ #define UN_TRANSLATE(x) (x)
526
522
  #endif
527
523
 
528
524
  #if _NUITKA_EXPERIMENTAL_FILE_TRACING
@@ -8,7 +8,9 @@
8
8
 
9
9
  extern bool PRINT_NEW_LINE(void);
10
10
  extern bool PRINT_ITEM(PyObject *object);
11
+ extern bool PRINT_ITEM_LINE(PyObject *object);
11
12
  extern bool PRINT_STRING(char const *str);
13
+ extern bool PRINT_STRING_W(wchar_t const *str);
12
14
  extern bool PRINT_FORMAT(char const *fmt, ...);
13
15
  extern bool PRINT_ITEM_TO(PyObject *file, PyObject *object);
14
16
  extern bool PRINT_NEW_LINE_TO(PyObject *file);
@@ -18,8 +18,8 @@
18
18
 
19
19
  struct Nuitka_MetaPathBasedLoaderEntry;
20
20
 
21
- typedef PyObject *(*module_initfunc)(PyThreadState *tstate, PyObject *module,
22
- struct Nuitka_MetaPathBasedLoaderEntry const *loader_entry);
21
+ typedef PyObject *(*module_init_func)(PyThreadState *tstate, PyObject *module,
22
+ struct Nuitka_MetaPathBasedLoaderEntry const *loader_entry);
23
23
 
24
24
  #if PYTHON_VERSION >= 0x370 && defined(_NUITKA_EXE) && !defined(_NUITKA_STANDALONE) && \
25
25
  defined(_NUITKA_FILE_REFERENCE_ORIGINAL_MODE)
@@ -31,7 +31,7 @@ struct Nuitka_MetaPathBasedLoaderEntry {
31
31
  char const *name;
32
32
 
33
33
  // Entry function if compiled module, otherwise NULL.
34
- module_initfunc python_initfunc;
34
+ module_init_func python_init_func;
35
35
 
36
36
  // For bytecode modules, start and size inside the constants blob.
37
37
  int bytecode_index;
@@ -55,8 +55,8 @@ struct Nuitka_MetaPathBasedLoaderEntry {
55
55
  /* For embedded modules, register the meta path based loader. Used by main
56
56
  * program/package only.
57
57
  */
58
- extern void registerMetaPathBasedUnfreezer(struct Nuitka_MetaPathBasedLoaderEntry *loader_entries,
59
- unsigned char **bytecode_data);
58
+ extern void registerMetaPathBasedLoader(struct Nuitka_MetaPathBasedLoaderEntry *loader_entries,
59
+ unsigned char **bytecode_data);
60
60
 
61
61
  /* Create a loader object responsible for a package. */
62
62
  extern PyObject *Nuitka_Loader_New(struct Nuitka_MetaPathBasedLoaderEntry const *entry);
@@ -41,7 +41,10 @@ class TMonitor(Thread):
41
41
  def exit(self):
42
42
  self.was_killed.set()
43
43
  if self is not current_thread():
44
- self.join()
44
+ if str is bytes:
45
+ self.join()
46
+ else:
47
+ self.join(timeout=1.0)
45
48
  return self.report()
46
49
 
47
50
  def get_instances(self):
@@ -375,8 +375,6 @@ static PySendResult _Nuitka_Asyncgen_sendR(PyThreadState *tstate, struct Nuitka_
375
375
 
376
376
  Nuitka_MarkAsyncgenAsNotRunning(asyncgen);
377
377
 
378
- tstate = PyThreadState_GET();
379
-
380
378
  // Remove the back frame from asyncgen if it's there.
381
379
  if (asyncgen->m_frame) {
382
380
  // assert(tstate->frame == &asyncgen->m_frame->m_frame);
@@ -1050,7 +1048,7 @@ static PyAsyncMethods Nuitka_Asyncgen_as_async = {
1050
1048
 
1051
1049
  // TODO: Set "__doc__" automatically for method clones of compiled types from
1052
1050
  // the documentation of built-in original type.
1053
- static PyGetSetDef Nuitka_Asyncgen_getsetlist[] = {
1051
+ static PyGetSetDef Nuitka_Asyncgen_tp_getset[] = {
1054
1052
  {(char *)"__name__", (getter)Nuitka_Asyncgen_get_name, (setter)Nuitka_Asyncgen_set_name, NULL},
1055
1053
  {(char *)"__qualname__", (getter)Nuitka_Asyncgen_get_qualname, (setter)Nuitka_Asyncgen_set_qualname, NULL},
1056
1054
  {(char *)"ag_await", (getter)Nuitka_Asyncgen_get_ag_await, (setter)NULL, NULL},
@@ -1095,7 +1093,7 @@ PyTypeObject Nuitka_Asyncgen_Type = {
1095
1093
  0, // tp_iternext
1096
1094
  Nuitka_Asyncgen_methods, // tp_methods
1097
1095
  Nuitka_Asyncgen_members, // tp_members
1098
- Nuitka_Asyncgen_getsetlist, // tp_getset
1096
+ Nuitka_Asyncgen_tp_getset, // tp_getset
1099
1097
  0, // tp_base
1100
1098
  0, // tp_dict
1101
1099
  0, // tp_descr_get
@@ -182,7 +182,7 @@ static int Nuitka_Cell_set_contents(struct Nuitka_CellObject *cell, PyObject *va
182
182
  }
183
183
  #endif
184
184
 
185
- static PyGetSetDef Nuitka_Cell_getsetlist[] = {
185
+ static PyGetSetDef Nuitka_Cell_tp_getset[] = {
186
186
  #if PYTHON_VERSION < 0x370
187
187
  {(char *)"cell_contents", (getter)Nuitka_Cell_get_contents, NULL, NULL},
188
188
  #else
@@ -218,12 +218,12 @@ PyTypeObject Nuitka_Cell_Type = {
218
218
  #else
219
219
  Nuitka_Cell_tp_richcompare, // tp_richcompare
220
220
  #endif
221
- 0, // tp_weaklistoffset
222
- 0, // tp_iter
223
- 0, // tp_iternext
224
- 0, // tp_methods
225
- 0, // tp_members
226
- Nuitka_Cell_getsetlist, // tp_getset
221
+ 0, // tp_weaklistoffset
222
+ 0, // tp_iter
223
+ 0, // tp_iternext
224
+ 0, // tp_methods
225
+ 0, // tp_members
226
+ Nuitka_Cell_tp_getset, // tp_getset
227
227
  };
228
228
 
229
229
  void _initCompiledCellType(void) { Nuitka_PyType_Ready(&Nuitka_Cell_Type, NULL, true, false, false, false, false); }