Nuitka-winsvc 2.3.11__cp311-cp311-win_amd64.whl → 2.4.5__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 (213) hide show
  1. Nuitka_winsvc-2.3.11.data/scripts/nuitka-run.bat → Nuitka_winsvc-2.4.5.data/scripts/nuitka-run.cmd +1 -1
  2. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/METADATA +1 -1
  3. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/RECORD +213 -210
  4. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/WHEEL +1 -1
  5. nuitka/CacheCleanup.py +6 -1
  6. nuitka/HardImportRegistry.py +30 -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/Progress.py +2 -1
  14. nuitka/PythonFlavors.py +22 -4
  15. nuitka/PythonVersions.py +18 -0
  16. nuitka/Tracing.py +1 -0
  17. nuitka/TreeXML.py +6 -3
  18. nuitka/Version.py +1 -1
  19. nuitka/__main__.py +55 -10
  20. nuitka/__past__.py +5 -0
  21. nuitka/build/Backend.scons +6 -1
  22. nuitka/build/CCompilerVersion.scons +1 -0
  23. nuitka/build/Onefile.scons +4 -0
  24. nuitka/build/SconsCaching.py +2 -1
  25. nuitka/build/SconsCompilerSettings.py +1 -0
  26. nuitka/build/SconsHacks.py +5 -1
  27. nuitka/build/SconsInterface.py +2 -0
  28. nuitka/build/SconsUtils.py +4 -1
  29. nuitka/build/include/nuitka/allocator.h +27 -5
  30. nuitka/build/include/nuitka/calling.h +1 -1
  31. nuitka/build/include/nuitka/compiled_frame.h +23 -23
  32. nuitka/build/include/nuitka/compiled_method.h +1 -1
  33. nuitka/build/include/nuitka/exception_groups.h +0 -2
  34. nuitka/build/include/nuitka/helper/attributes.h +7 -1
  35. nuitka/build/include/nuitka/helper/subscripts.h +1 -1
  36. nuitka/build/include/nuitka/helpers.h +10 -3
  37. nuitka/build/include/nuitka/prelude.h +6 -15
  38. nuitka/build/include/nuitka/printing.h +2 -0
  39. nuitka/build/include/nuitka/unfreezing.h +11 -5
  40. nuitka/build/inline_copy/tqdm/tqdm/_monitor.py +4 -1
  41. nuitka/build/static_src/CompiledAsyncgenType.c +2 -4
  42. nuitka/build/static_src/CompiledCellType.c +7 -7
  43. nuitka/build/static_src/CompiledCodeHelpers.c +49 -36
  44. nuitka/build/static_src/CompiledCoroutineType.c +2 -4
  45. nuitka/build/static_src/CompiledFrameType.c +109 -82
  46. nuitka/build/static_src/CompiledFunctionType.c +36 -9
  47. nuitka/build/static_src/CompiledGeneratorType.c +12 -10
  48. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +2 -2
  49. nuitka/build/static_src/CompiledMethodType.c +14 -13
  50. nuitka/build/static_src/HelpersAttributes.c +13 -15
  51. nuitka/build/static_src/HelpersBuiltin.c +16 -7
  52. nuitka/build/static_src/HelpersCalling.c +13 -13
  53. nuitka/build/static_src/HelpersCallingGenerated.c +22 -22
  54. nuitka/build/static_src/HelpersComparisonEq.c +110 -110
  55. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -1
  56. nuitka/build/static_src/HelpersComparisonGe.c +110 -110
  57. nuitka/build/static_src/HelpersComparisonGt.c +110 -110
  58. nuitka/build/static_src/HelpersComparisonLe.c +110 -110
  59. nuitka/build/static_src/HelpersComparisonLt.c +110 -110
  60. nuitka/build/static_src/HelpersComparisonNe.c +110 -110
  61. nuitka/build/static_src/HelpersConstantsBlob.c +480 -481
  62. nuitka/build/static_src/HelpersDictionaries.c +9 -0
  63. nuitka/build/static_src/HelpersFilesystemPaths.c +28 -13
  64. nuitka/build/static_src/HelpersImport.c +1 -1
  65. nuitka/build/static_src/HelpersLists.c +5 -1
  66. nuitka/build/static_src/HelpersMatching.c +95 -35
  67. nuitka/build/static_src/HelpersOperationInplaceAdd.c +23 -23
  68. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -0
  69. nuitka/build/static_src/HelpersOperationInplaceBitand.c +11 -11
  70. nuitka/build/static_src/HelpersOperationInplaceBitor.c +11 -11
  71. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +11 -11
  72. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +17 -17
  73. nuitka/build/static_src/HelpersOperationInplaceLshift.c +9 -9
  74. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  75. nuitka/build/static_src/HelpersOperationInplaceMod.c +47 -47
  76. nuitka/build/static_src/HelpersOperationInplaceMult.c +28 -28
  77. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +17 -17
  78. nuitka/build/static_src/HelpersOperationInplacePow.c +17 -17
  79. nuitka/build/static_src/HelpersOperationInplaceRshift.c +9 -9
  80. nuitka/build/static_src/HelpersOperationInplaceSub.c +17 -17
  81. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +17 -17
  82. nuitka/build/static_src/HelpersSequences.c +1 -1
  83. nuitka/build/static_src/HelpersTypes.c +8 -4
  84. nuitka/build/static_src/InspectPatcher.c +14 -2
  85. nuitka/build/static_src/MainProgram.c +20 -1
  86. nuitka/build/static_src/MetaPathBasedLoader.c +163 -140
  87. nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +13 -4
  88. nuitka/build/static_src/OnefileBootstrap.c +100 -6
  89. nuitka/code_generation/AttributeCodes.py +12 -10
  90. nuitka/code_generation/CodeGeneration.py +6 -7
  91. nuitka/code_generation/ConstantCodes.py +53 -10
  92. nuitka/code_generation/Emission.py +1 -1
  93. nuitka/code_generation/GlobalConstants.py +6 -6
  94. nuitka/code_generation/Indentation.py +4 -5
  95. nuitka/code_generation/LoaderCodes.py +3 -0
  96. nuitka/code_generation/LocalsDictCodes.py +36 -14
  97. nuitka/code_generation/MatchCodes.py +23 -4
  98. nuitka/code_generation/ModuleCodes.py +1 -8
  99. nuitka/code_generation/Namify.py +2 -0
  100. nuitka/code_generation/PackageResourceCodes.py +5 -1
  101. nuitka/code_generation/templates/CodeTemplatesConstants.py +22 -4
  102. nuitka/code_generation/templates/CodeTemplatesLoader.py +1 -1
  103. nuitka/code_generation/templates/CodeTemplatesModules.py +27 -9
  104. nuitka/code_generation/templates/CodeTemplatesVariables.py +16 -2
  105. nuitka/code_generation/templates_c/CodeTemplateCallsMethodPositional.c.j2 +2 -2
  106. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +1 -1
  107. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  108. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +7 -7
  109. nuitka/freezer/DependsExe.py +3 -1
  110. nuitka/freezer/DllDependenciesMacOS.py +5 -12
  111. nuitka/freezer/IncludedDataFiles.py +15 -4
  112. nuitka/freezer/IncludedEntryPoints.py +8 -2
  113. nuitka/freezer/Onefile.py +6 -1
  114. nuitka/freezer/Standalone.py +9 -2
  115. nuitka/importing/Importing.py +14 -5
  116. nuitka/importing/Recursion.py +3 -0
  117. nuitka/nodes/AttributeNodesGenerated.py +21 -12
  118. nuitka/nodes/BuiltinOpenNodes.py +5 -0
  119. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +11 -11
  120. nuitka/nodes/BuiltinRefNodes.py +41 -1
  121. nuitka/nodes/ChildrenHavingMixins.py +143 -355
  122. nuitka/nodes/ClassNodes.py +30 -12
  123. nuitka/nodes/CodeObjectSpecs.py +9 -0
  124. nuitka/nodes/ExpressionBasesGenerated.py +11 -11
  125. nuitka/nodes/FunctionNodes.py +7 -11
  126. nuitka/nodes/FutureSpecs.py +16 -3
  127. nuitka/nodes/GeneratorNodes.py +2 -2
  128. nuitka/nodes/HardImportNodesGenerated.py +11 -134
  129. nuitka/nodes/LocalsScopes.py +19 -23
  130. nuitka/nodes/MatchNodes.py +18 -7
  131. nuitka/nodes/ModuleAttributeNodes.py +1 -20
  132. nuitka/nodes/ModuleNodes.py +23 -6
  133. nuitka/nodes/NodeBases.py +3 -2
  134. nuitka/nodes/NodeMetaClasses.py +26 -10
  135. nuitka/nodes/ReturnNodes.py +1 -1
  136. nuitka/nodes/StatementBasesGenerated.py +11 -11
  137. nuitka/nodes/SubscriptNodes.py +4 -4
  138. nuitka/nodes/VariableAssignNodes.py +1 -1
  139. nuitka/nodes/VariableRefNodes.py +28 -2
  140. nuitka/optimizations/FunctionInlining.py +3 -6
  141. nuitka/optimizations/Optimization.py +13 -12
  142. nuitka/optimizations/TraceCollections.py +19 -4
  143. nuitka/plugins/PluginBase.py +121 -133
  144. nuitka/plugins/Plugins.py +92 -4
  145. nuitka/plugins/YamlPluginBase.py +121 -0
  146. nuitka/plugins/standard/AntiBloatPlugin.py +87 -28
  147. nuitka/plugins/standard/DataFilesPlugin.py +15 -6
  148. nuitka/plugins/standard/DelvewheelPlugin.py +7 -3
  149. nuitka/plugins/standard/DllFilesPlugin.py +5 -3
  150. nuitka/plugins/standard/ImplicitImports.py +34 -20
  151. nuitka/plugins/standard/MatplotlibPlugin.py +3 -1
  152. nuitka/plugins/standard/MultiprocessingPlugin.py +2 -2
  153. nuitka/plugins/standard/OptionsNannyPlugin.py +1 -1
  154. nuitka/plugins/standard/PySidePyQtPlugin.py +11 -12
  155. nuitka/plugins/standard/SpacyPlugin.py +136 -0
  156. nuitka/plugins/standard/standard.nuitka-package.config.yml +489 -182
  157. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +6 -0
  158. nuitka/reports/Reports.py +53 -5
  159. nuitka/specs/BuiltinParameterSpecs.py +1 -1
  160. nuitka/specs/HardImportSpecs.py +0 -6
  161. nuitka/tools/data_composer/DataComposer.py +29 -27
  162. nuitka/tools/environments/CreateEnvironment.py +1 -0
  163. nuitka/tools/environments/Virtualenv.py +25 -11
  164. nuitka/tools/general/find_module/FindModuleCode.py +13 -3
  165. nuitka/tools/onefile_compressor/OnefileCompressor.py +21 -4
  166. nuitka/tools/scanning/DisplayPackageDLLs.py +17 -3
  167. nuitka/tools/specialize/CTypeDescriptions.py +13 -7
  168. nuitka/tools/specialize/SpecializePython.py +18 -1
  169. nuitka/tools/testing/Common.py +19 -6
  170. nuitka/tools/testing/check_reference_counts/__main__.py +1 -1
  171. nuitka/tools/testing/run_nuitka_tests/__main__.py +0 -20
  172. nuitka/tools/watch/AutoStage.py +144 -0
  173. nuitka/tools/watch/__main__.py +79 -32
  174. nuitka/tree/Building.py +105 -104
  175. nuitka/tree/ComplexCallHelperFunctions.py +16 -26
  176. nuitka/tree/InternalModule.py +8 -0
  177. nuitka/tree/ReformulationAssignmentStatements.py +29 -59
  178. nuitka/tree/ReformulationClasses.py +10 -17
  179. nuitka/tree/ReformulationClasses3.py +69 -43
  180. nuitka/tree/ReformulationComparisonExpressions.py +6 -16
  181. nuitka/tree/ReformulationContractionExpressions.py +14 -23
  182. nuitka/tree/ReformulationDictionaryCreation.py +6 -10
  183. nuitka/tree/ReformulationExecStatements.py +10 -10
  184. nuitka/tree/ReformulationForLoopStatements.py +6 -12
  185. nuitka/tree/ReformulationFunctionStatements.py +21 -28
  186. nuitka/tree/ReformulationImportStatements.py +8 -10
  187. nuitka/tree/ReformulationLambdaExpressions.py +3 -6
  188. nuitka/tree/ReformulationMatchStatements.py +166 -60
  189. nuitka/tree/ReformulationMultidist.py +3 -1
  190. nuitka/tree/ReformulationNamespacePackages.py +1 -1
  191. nuitka/tree/ReformulationPrintStatements.py +3 -6
  192. nuitka/tree/ReformulationSequenceCreation.py +13 -26
  193. nuitka/tree/ReformulationTryFinallyStatements.py +15 -0
  194. nuitka/tree/ReformulationWithStatements.py +12 -16
  195. nuitka/tree/SourceHandling.py +13 -8
  196. nuitka/tree/VariableClosure.py +5 -21
  197. nuitka/utils/Distributions.py +80 -11
  198. nuitka/utils/Download.py +38 -31
  199. nuitka/utils/Execution.py +13 -2
  200. nuitka/utils/FileOperations.py +55 -28
  201. nuitka/utils/Images.py +6 -1
  202. nuitka/utils/Importing.py +1 -1
  203. nuitka/utils/ModuleNames.py +11 -5
  204. nuitka/utils/ReExecute.py +17 -13
  205. nuitka/utils/SharedLibraries.py +32 -8
  206. nuitka/utils/Signing.py +3 -1
  207. nuitka/utils/StaticLibraries.py +51 -41
  208. nuitka/utils/Timing.py +1 -1
  209. nuitka/utils/Utils.py +29 -7
  210. /Nuitka_winsvc-2.3.11.data/scripts/nuitka.bat → /Nuitka_winsvc-2.4.5.data/scripts/nuitka.cmd +0 -0
  211. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/LICENSE.txt +0 -0
  212. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/entry_points.txt +0 -0
  213. {Nuitka_winsvc-2.3.11.dist-info → Nuitka_winsvc-2.4.5.dist-info}/top_level.txt +0 -0
nuitka/__main__.py CHANGED
@@ -14,6 +14,36 @@ or package, that can contain all used modules too.
14
14
  import os
15
15
  import sys
16
16
 
17
+ _cached_process_environments = {}
18
+
19
+
20
+ def getLaunchingNuitkaProcessEnvironmentValue(environment_variable_name):
21
+ if environment_variable_name not in _cached_process_environments:
22
+ _cached_process_environments[environment_variable_name] = os.getenv(
23
+ environment_variable_name
24
+ )
25
+ if _cached_process_environments[environment_variable_name] is not None:
26
+ del os.environ[environment_variable_name]
27
+
28
+ value = _cached_process_environments[environment_variable_name]
29
+
30
+ if value is not None and ":" not in value:
31
+ value = None
32
+
33
+ if value is not None:
34
+ pid, value = value.split(":", 1)
35
+
36
+ try:
37
+ pid = int(pid)
38
+ except ValueError:
39
+ value = None
40
+ else:
41
+ if os.name != "nt":
42
+ if pid != os.getpid():
43
+ value = None
44
+
45
+ return value
46
+
17
47
 
18
48
  def main():
19
49
  # PyLint for Python3 thinks we import from ourselves if we really
@@ -35,21 +65,25 @@ def main():
35
65
  )
36
66
  sys.exit(1)
37
67
 
38
- if "NUITKA_BINARY_NAME" in os.environ:
39
- sys.argv[0] = os.environ["NUITKA_BINARY_NAME"]
68
+ nuitka_binary_name = getLaunchingNuitkaProcessEnvironmentValue("NUITKA_BINARY_NAME")
69
+ if nuitka_binary_name is not None:
70
+ sys.argv[0] = nuitka_binary_name
71
+
72
+ nuitka_pythonpath_ast = getLaunchingNuitkaProcessEnvironmentValue(
73
+ "NUITKA_PYTHONPATH_AST"
74
+ )
40
75
 
41
- if "NUITKA_PYTHONPATH_AST" in os.environ:
76
+ if nuitka_pythonpath_ast is not None:
42
77
  # Restore the PYTHONPATH gained from the site module, that we chose not
43
78
  # to have imported during compilation. For loading "ast" module, we need
44
79
  # one element, that is not necessarily in our current path, but we use
45
80
  # that to evaluate the current path.
46
- sys.path = [os.environ["NUITKA_PYTHONPATH_AST"]]
81
+ sys.path = [nuitka_pythonpath_ast]
47
82
  import ast
48
83
 
49
- del os.environ["NUITKA_PYTHONPATH_AST"]
50
-
51
- sys.path = ast.literal_eval(os.environ["NUITKA_PYTHONPATH"])
52
- del os.environ["NUITKA_PYTHONPATH"]
84
+ sys.path = ast.literal_eval(
85
+ getLaunchingNuitkaProcessEnvironmentValue("NUITKA_PYTHONPATH")
86
+ )
53
87
  else:
54
88
  # Remove path element added for being called via "__main__.py", this can
55
89
  # only lead to trouble, having e.g. a "distutils" in sys.path that comes
@@ -103,6 +137,13 @@ def main():
103
137
 
104
138
  warnings.simplefilter("ignore", DeprecationWarning)
105
139
 
140
+ # Hack, we need this to bootstrap and it's actually living in __main__
141
+ # module of nuitka package and renamed to where we can get at easily for
142
+ # other uses.
143
+ __import__("nuitka").getLaunchingNuitkaProcessEnvironmentValue = (
144
+ getLaunchingNuitkaProcessEnvironmentValue
145
+ )
146
+
106
147
  from nuitka import Options # isort:skip
107
148
 
108
149
  Options.parseArgs()
@@ -151,11 +192,15 @@ def main():
151
192
 
152
193
 
153
194
  if __name__ == "__main__":
154
- if "NUITKA_PACKAGE_HOME" in os.environ:
155
- sys.path.insert(0, os.environ["NUITKA_PACKAGE_HOME"])
195
+ _nuitka_package_home = getLaunchingNuitkaProcessEnvironmentValue(
196
+ "NUITKA_PACKAGE_HOME"
197
+ )
198
+ if _nuitka_package_home is not None:
199
+ sys.path.insert(0, _nuitka_package_home)
156
200
 
157
201
  import nuitka # just to have it loaded from there, pylint: disable=unused-import
158
202
 
203
+ assert sys.path[0] is _nuitka_package_home
159
204
  del sys.path[0]
160
205
 
161
206
  main()
nuitka/__past__.py CHANGED
@@ -168,6 +168,11 @@ try:
168
168
  except NameError:
169
169
  BaseExceptionGroup = None
170
170
 
171
+ try:
172
+ BrokenPipeError = BrokenPipeError # pylint: disable=I0021,redefined-builtin
173
+ except NameError:
174
+ BrokenPipeError = OSError
175
+
171
176
  try:
172
177
  _md5()
173
178
  except ValueError:
@@ -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.",
@@ -278,7 +279,7 @@ def _getCcacheStatistics(ccache_logfile):
278
279
  # can be matched against it.
279
280
  commands = {}
280
281
 
281
- for line in getFileContentByLine(ccache_logfile):
282
+ for line in getFileContentByLine(ccache_logfile, encoding="utf8"):
282
283
  match = re_command.match(line)
283
284
 
284
285
  if match:
@@ -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) {
@@ -294,7 +294,11 @@ extern PyObject *BUILTIN_LONG2(PyThreadState *tstate, PyObject *value, PyObject
294
294
  // For the constant loading:
295
295
 
296
296
  // Call this to initialize all common constants pre-main.
297
+ #if defined(_NUITKA_MODULE) && PYTHON_VERSION >= 0x3c0
298
+ extern void createGlobalConstants(PyThreadState *tstate, PyObject *real_module_name);
299
+ #else
297
300
  extern void createGlobalConstants(PyThreadState *tstate);
301
+ #endif
298
302
 
299
303
  // Call this to check of common constants are still intact.
300
304
  #ifndef __NUITKA_NO_ASSERT__
@@ -334,8 +338,8 @@ extern void patchTracebackDealloc(void);
334
338
  // Initialize value for "tp_compare" and "tp_init" defaults.
335
339
  extern void _initSlotCompare(void);
336
340
 
337
- // Default __init__ slot wrapper.
338
- extern python_initproc default_tp_init_wrapper;
341
+ // Default __init__ slot wrapper, spell-checker: ignore initproc
342
+ extern python_init_proc default_tp_init_wrapper;
339
343
 
340
344
  #if PYTHON_VERSION >= 0x300
341
345
  // Select the metaclass from specified one and given bases.
@@ -343,7 +347,8 @@ extern PyObject *SELECT_METACLASS(PyThreadState *tstate, PyObject *metaclass, Py
343
347
  #endif
344
348
 
345
349
  #if PYTHON_VERSION >= 0x3a0
346
- extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, Py_ssize_t max_allowed);
350
+ extern PyObject *MATCH_CLASS_ARGS(PyThreadState *tstate, PyObject *matched, PyObject *matched_type,
351
+ Py_ssize_t positional_count, PyObject **keywords, Py_ssize_t keywords_count);
347
352
  #endif
348
353
 
349
354
  NUITKA_MAY_BE_UNUSED static PyObject *MODULE_NAME1(PyThreadState *tstate, PyObject *module) {
@@ -413,6 +418,8 @@ extern PyObject *Py_SysVersionInfo;
413
418
 
414
419
  extern PyObject *MAKE_UNION_TYPE(PyObject *args);
415
420
 
421
+ // Our wrapper for "PyType_Ready" that takes care of trying to avoid DLL entry
422
+ // points for generic attributes. spell-checker: ignore aiter
416
423
  extern void Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool generic_get_attr, bool generic_set_attr,
417
424
  bool self_iter, bool await_self_iter, bool self_aiter);
418
425
 
@@ -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.
@@ -463,11 +459,6 @@ static inline PyObject *_Py_XNewRef(PyObject *obj) {
463
459
  #define NuitkaType_HasFeatureClass(descr) (1)
464
460
  #endif
465
461
 
466
- // For newer Python, this API was moved to global state
467
- #if PYTHON_VERSION >= 0x3c0
468
- #define _Py_PackageContext (_PyRuntime.imports.pkgcontext)
469
- #endif
470
-
471
462
  // Our replacement for "PyType_IsSubtype"
472
463
  extern bool Nuitka_Type_IsSubtype(PyTypeObject *a, PyTypeObject *b);
473
464
 
@@ -522,7 +513,7 @@ extern PyObject *Nuitka_dunder_compiled_value;
522
513
  #include "nuitka_data_decoder.h"
523
514
  #else
524
515
  #define DECODE(x) assert(x)
525
- #define UNTRANSLATE(x) (x)
516
+ #define UN_TRANSLATE(x) (x)
526
517
  #endif
527
518
 
528
519
  #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,14 @@ 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
+
61
+ // For module mode, embedded modules may have to be shifted to below the
62
+ // namespace they are loaded into.
63
+ #ifdef _NUITKA_MODULE
64
+ extern void updateMetaPathBasedLoaderModuleRoot(char const *module_root_name);
65
+ #endif
60
66
 
61
67
  /* Create a loader object responsible for a package. */
62
68
  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