Nuitka-winsvc 2.1.6__cp311-cp311-win_amd64.whl → 2.2.2__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 (234) hide show
  1. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/RECORD +234 -225
  3. nuitka/Errors.py +4 -0
  4. nuitka/HardImportRegistry.py +18 -1
  5. nuitka/MainControl.py +27 -30
  6. nuitka/OptionParsing.py +32 -30
  7. nuitka/Options.py +26 -13
  8. nuitka/OutputDirectories.py +7 -4
  9. nuitka/PostProcessing.py +9 -7
  10. nuitka/Progress.py +3 -3
  11. nuitka/PythonVersions.py +2 -2
  12. nuitka/TreeXML.py +1 -1
  13. nuitka/Version.py +1 -1
  14. nuitka/build/Backend.scons +2 -1
  15. nuitka/build/DataComposerInterface.py +1 -0
  16. nuitka/build/Onefile.scons +2 -1
  17. nuitka/build/SconsCaching.py +64 -46
  18. nuitka/build/SconsCompilerSettings.py +19 -6
  19. nuitka/build/SconsHacks.py +0 -1
  20. nuitka/build/SconsInterface.py +84 -5
  21. nuitka/build/SconsProgress.py +0 -1
  22. nuitka/build/SconsUtils.py +8 -4
  23. nuitka/build/include/nuitka/allocator.h +8 -3
  24. nuitka/build/include/nuitka/compiled_cell.h +8 -0
  25. nuitka/build/include/nuitka/exceptions.h +554 -179
  26. nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
  27. nuitka/build/include/nuitka/helper/import_hard.h +3 -0
  28. nuitka/build/include/nuitka/helper/ints.h +15 -2
  29. nuitka/build/include/nuitka/helper/lists.h +4 -1
  30. nuitka/build/include/nuitka/helper/raising.h +12 -0
  31. nuitka/build/include/nuitka/helper/tuples.h +5 -1
  32. nuitka/build/include/nuitka/helpers.h +4 -0
  33. nuitka/build/include/nuitka/importing.h +3 -4
  34. nuitka/build/include/nuitka/jit_sources.h +25 -0
  35. nuitka/build/include/nuitka/prelude.h +38 -11
  36. nuitka/build/include/nuitka/printing.h +3 -0
  37. nuitka/build/include/nuitka/threading.h +2 -6
  38. nuitka/build/include/nuitka/type_aliases.h +27 -0
  39. nuitka/build/inline_copy/pkg_resources/pkg_resources/__init__.py +0 -3
  40. nuitka/build/inline_copy/tqdm/tqdm/version.py +1 -4
  41. nuitka/build/static_src/CompiledAsyncgenType.c +99 -114
  42. nuitka/build/static_src/CompiledCodeHelpers.c +23 -14
  43. nuitka/build/static_src/CompiledCoroutineType.c +96 -114
  44. nuitka/build/static_src/CompiledFrameType.c +14 -11
  45. nuitka/build/static_src/CompiledFunctionType.c +34 -7
  46. nuitka/build/static_src/CompiledGeneratorType.c +248 -142
  47. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +60 -70
  48. nuitka/build/static_src/CompiledMethodType.c +8 -7
  49. nuitka/build/static_src/HelpersAttributes.c +2 -19
  50. nuitka/build/static_src/HelpersBuiltin.c +2 -1
  51. nuitka/build/static_src/HelpersComparisonEq.c +32 -18
  52. nuitka/build/static_src/HelpersComparisonGe.c +50 -36
  53. nuitka/build/static_src/HelpersComparisonGt.c +50 -36
  54. nuitka/build/static_src/HelpersComparisonLe.c +50 -36
  55. nuitka/build/static_src/HelpersComparisonLt.c +50 -36
  56. nuitka/build/static_src/HelpersComparisonNe.c +32 -18
  57. nuitka/build/static_src/HelpersDeepcopy.c +6 -8
  58. nuitka/build/static_src/HelpersDictionaries.c +8 -3
  59. nuitka/build/static_src/HelpersExceptions.c +42 -28
  60. nuitka/build/static_src/HelpersFilesystemPaths.c +7 -7
  61. nuitka/build/static_src/HelpersImportHard.c +15 -0
  62. nuitka/build/static_src/HelpersJitSources.c +46 -0
  63. nuitka/build/static_src/HelpersLists.c +40 -0
  64. nuitka/build/static_src/HelpersOperationBinaryAdd.c +66 -66
  65. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +80 -33
  66. nuitka/build/static_src/HelpersOperationBinaryMultUtils.c +16 -13
  67. nuitka/build/static_src/HelpersOperationBinarySub.c +39 -39
  68. nuitka/build/static_src/HelpersOperationInplaceAdd.c +54 -54
  69. nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +1 -1
  70. nuitka/build/static_src/HelpersOperationInplaceSub.c +50 -50
  71. nuitka/build/static_src/HelpersProfiling.c +3 -4
  72. nuitka/build/static_src/HelpersRaising.c +62 -1
  73. nuitka/build/static_src/HelpersStrings.c +203 -8
  74. nuitka/build/static_src/HelpersTypes.c +42 -0
  75. nuitka/build/static_src/MainProgram.c +1 -1
  76. nuitka/build/static_src/MetaPathBasedLoader.c +2 -1
  77. nuitka/build/static_src/OnefileBootstrap.c +3 -3
  78. nuitka/code_generation/BinaryOperationHelperDefinitions.py +5 -3
  79. nuitka/code_generation/BuiltinCodes.py +1 -0
  80. nuitka/code_generation/CodeGeneration.py +11 -0
  81. nuitka/code_generation/CodeHelpers.py +5 -3
  82. nuitka/code_generation/CodeObjectCodes.py +10 -6
  83. nuitka/code_generation/ComparisonCodes.py +19 -3
  84. nuitka/code_generation/ConstantCodes.py +5 -0
  85. nuitka/code_generation/Contexts.py +22 -6
  86. nuitka/code_generation/Emission.py +1 -0
  87. nuitka/code_generation/ErrorCodes.py +8 -16
  88. nuitka/code_generation/EvalCodes.py +5 -3
  89. nuitka/code_generation/ExceptionCodes.py +8 -1
  90. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +1 -0
  91. nuitka/code_generation/FrameCodes.py +5 -3
  92. nuitka/code_generation/FunctionCodes.py +0 -1
  93. nuitka/code_generation/GeneratorCodes.py +3 -3
  94. nuitka/code_generation/GlobalConstants.py +0 -2
  95. nuitka/code_generation/ImportCodes.py +2 -0
  96. nuitka/code_generation/JitCodes.py +44 -0
  97. nuitka/code_generation/ListCodes.py +11 -17
  98. nuitka/code_generation/MatchCodes.py +0 -1
  99. nuitka/code_generation/ModuleCodes.py +2 -1
  100. nuitka/code_generation/Namify.py +0 -1
  101. nuitka/code_generation/NetworkxCodes.py +51 -0
  102. nuitka/code_generation/OperationCodes.py +8 -6
  103. nuitka/code_generation/PackageResourceCodes.py +7 -5
  104. nuitka/code_generation/TensorflowCodes.py +54 -0
  105. nuitka/code_generation/TypeAliasCodes.py +71 -0
  106. nuitka/code_generation/VariableCodes.py +7 -5
  107. nuitka/code_generation/VariableDeclarations.py +1 -0
  108. nuitka/code_generation/c_types/CTypeCLongs.py +0 -1
  109. nuitka/code_generation/c_types/CTypeNuitkaInts.py +0 -1
  110. nuitka/code_generation/c_types/CTypeVoids.py +1 -0
  111. nuitka/code_generation/templates/CodeTemplatesConstants.py +14 -0
  112. nuitka/code_generation/templates/CodeTemplatesExceptions.py +1 -1
  113. nuitka/code_generation/templates/CodeTemplatesIterators.py +0 -1
  114. nuitka/code_generation/templates/CodeTemplatesLoader.py +0 -1
  115. nuitka/code_generation/templates/CodeTemplatesModules.py +9 -4
  116. nuitka/code_generation/templates/CodeTemplatesVariables.py +8 -8
  117. nuitka/code_generation/templates/TemplateDebugWrapper.py +0 -1
  118. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -0
  119. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +9 -7
  120. nuitka/containers/Namedtuples.py +0 -1
  121. nuitka/finalizations/Finalization.py +1 -0
  122. nuitka/finalizations/FinalizeMarkups.py +0 -1
  123. nuitka/freezer/DllDependenciesMacOS.py +60 -13
  124. nuitka/freezer/DllDependenciesPosix.py +0 -1
  125. nuitka/freezer/DllDependenciesWin32.py +2 -1
  126. nuitka/freezer/IncludedDataFiles.py +46 -15
  127. nuitka/freezer/IncludedEntryPoints.py +5 -3
  128. nuitka/freezer/Standalone.py +6 -1
  129. nuitka/importing/ImportCache.py +2 -2
  130. nuitka/importing/ImportResolving.py +80 -78
  131. nuitka/importing/Importing.py +34 -1
  132. nuitka/nodes/AttributeNodesGenerated.py +21 -6
  133. nuitka/nodes/BuiltinComplexNodes.py +1 -0
  134. nuitka/nodes/BuiltinFormatNodes.py +1 -0
  135. nuitka/nodes/BuiltinIteratorNodes.py +5 -3
  136. nuitka/nodes/BuiltinOperationNodeBasesGenerated.py +21 -6
  137. nuitka/nodes/BuiltinRefNodes.py +8 -1
  138. nuitka/nodes/BuiltinVarsNodes.py +0 -1
  139. nuitka/nodes/ChildrenHavingMixins.py +906 -186
  140. nuitka/nodes/CodeObjectSpecs.py +1 -1
  141. nuitka/nodes/ConditionalNodes.py +2 -6
  142. nuitka/nodes/ConstantRefNodes.py +38 -0
  143. nuitka/nodes/CtypesNodes.py +0 -1
  144. nuitka/nodes/DictionaryNodes.py +0 -1
  145. nuitka/nodes/ExceptionNodes.py +10 -0
  146. nuitka/nodes/ExpressionBases.py +15 -9
  147. nuitka/nodes/ExpressionBasesGenerated.py +32 -15
  148. nuitka/nodes/FunctionNodes.py +50 -5
  149. nuitka/nodes/HardImportNodesGenerated.py +245 -60
  150. nuitka/nodes/ImportHardNodes.py +27 -13
  151. nuitka/nodes/ImportNodes.py +92 -70
  152. nuitka/nodes/InjectCNodes.py +0 -1
  153. nuitka/nodes/ModuleNodes.py +10 -5
  154. nuitka/nodes/NetworkxNodes.py +45 -0
  155. nuitka/nodes/OperatorNodesUnary.py +1 -0
  156. nuitka/nodes/OsSysNodes.py +0 -1
  157. nuitka/nodes/PackageMetadataNodes.py +0 -1
  158. nuitka/nodes/PackageResourceNodes.py +10 -6
  159. nuitka/nodes/StatementBasesGenerated.py +107 -60
  160. nuitka/nodes/StringConcatenationNodes.py +1 -0
  161. nuitka/nodes/TensorflowNodes.py +38 -0
  162. nuitka/nodes/TypeNodes.py +21 -0
  163. nuitka/nodes/VariableRefNodes.py +1 -0
  164. nuitka/nodes/shapes/BuiltinTypeShapes.py +25 -15
  165. nuitka/optimizations/Optimization.py +7 -6
  166. nuitka/optimizations/OptimizeBuiltinCalls.py +11 -9
  167. nuitka/optimizations/Tags.py +0 -1
  168. nuitka/optimizations/TraceCollections.py +6 -55
  169. nuitka/optimizations/ValueTraces.py +49 -1
  170. nuitka/plugins/PluginBase.py +26 -4
  171. nuitka/plugins/Plugins.py +49 -12
  172. nuitka/plugins/standard/AntiBloatPlugin.py +12 -2
  173. nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +0 -1
  174. nuitka/plugins/standard/DataFilesPlugin.py +2 -6
  175. nuitka/plugins/standard/DillPlugin.py +3 -3
  176. nuitka/plugins/standard/DllFilesPlugin.py +29 -23
  177. nuitka/plugins/standard/GiPlugin.py +1 -0
  178. nuitka/plugins/standard/ImplicitImports.py +8 -7
  179. nuitka/plugins/standard/MatplotlibPlugin.py +1 -0
  180. nuitka/plugins/standard/OptionsNannyPlugin.py +3 -7
  181. nuitka/plugins/standard/PkgResourcesPlugin.py +0 -1
  182. nuitka/plugins/standard/PmwPlugin.py +10 -9
  183. nuitka/plugins/standard/PySidePyQtPlugin.py +0 -28
  184. nuitka/plugins/standard/TensorflowPlugin.py +1 -0
  185. nuitka/plugins/standard/TorchPlugin.py +1 -0
  186. nuitka/plugins/standard/TrioPlugin.py +1 -0
  187. nuitka/plugins/standard/standard.nuitka-package.config.yml +249 -34
  188. nuitka/reports/CompilationReportReader.py +0 -1
  189. nuitka/reports/Reports.py +49 -5
  190. nuitka/specs/BuiltinParameterSpecs.py +10 -2
  191. nuitka/specs/BuiltinStrOperationSpecs.py +1 -1
  192. nuitka/specs/BuiltinTypeOperationSpecs.py +0 -1
  193. nuitka/specs/HardImportSpecs.py +34 -1
  194. nuitka/specs/ParameterSpecs.py +11 -9
  195. nuitka/tools/environments/Virtualenv.py +0 -1
  196. nuitka/tools/specialize/CTypeDescriptions.py +15 -11
  197. nuitka/tools/specialize/SpecializeC.py +11 -9
  198. nuitka/tools/specialize/SpecializePython.py +57 -30
  199. nuitka/tools/testing/Common.py +24 -7
  200. nuitka/tools/testing/OutputComparison.py +4 -0
  201. nuitka/tools/testing/Pythons.py +0 -1
  202. nuitka/tools/testing/compare_with_cpython/__main__.py +0 -4
  203. nuitka/tools/watch/GitHub.py +4 -1
  204. nuitka/tools/watch/__main__.py +22 -1
  205. nuitka/tree/Building.py +3 -0
  206. nuitka/tree/InternalModule.py +0 -1
  207. nuitka/tree/ReformulationAssertStatements.py +1 -0
  208. nuitka/tree/ReformulationAssignmentStatements.py +26 -3
  209. nuitka/tree/ReformulationClasses3.py +23 -26
  210. nuitka/tree/ReformulationContractionExpressions.py +5 -3
  211. nuitka/tree/ReformulationDictionaryCreation.py +6 -5
  212. nuitka/tree/ReformulationExecStatements.py +8 -6
  213. nuitka/tree/ReformulationFunctionStatements.py +10 -6
  214. nuitka/tree/SourceHandling.py +8 -0
  215. nuitka/tree/TreeHelpers.py +6 -3
  216. nuitka/utils/AppDirs.py +6 -2
  217. nuitka/utils/CStrings.py +1 -1
  218. nuitka/utils/CommandLineOptions.py +0 -1
  219. nuitka/utils/Distributions.py +3 -3
  220. nuitka/utils/Download.py +5 -1
  221. nuitka/utils/Execution.py +6 -3
  222. nuitka/utils/FileOperations.py +61 -34
  223. nuitka/utils/Importing.py +4 -4
  224. nuitka/utils/InstanceCounters.py +1 -0
  225. nuitka/utils/MacOSApp.py +1 -0
  226. nuitka/utils/Shebang.py +1 -0
  227. nuitka/utils/Utils.py +39 -1
  228. nuitka/utils/WindowsFileUsage.py +4 -3
  229. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.2.data}/scripts/nuitka-run.bat +0 -0
  230. {Nuitka_winsvc-2.1.6.data → Nuitka_winsvc-2.2.2.data}/scripts/nuitka.bat +0 -0
  231. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/LICENSE.txt +0 -0
  232. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/WHEEL +0 -0
  233. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/entry_points.txt +0 -0
  234. {Nuitka_winsvc-2.1.6.dist-info → Nuitka_winsvc-2.2.2.dist-info}/top_level.txt +0 -0
@@ -396,7 +396,7 @@ extern void DICT_CLEAR(PyObject *dict);
396
396
  // Replacement for PyDict_Next that is faster (to call).
397
397
  extern bool Nuitka_DictNext(PyObject *dict, Py_ssize_t *pos, PyObject **key_ptr, PyObject **value_ptr);
398
398
 
399
- #if PYTHON_VERSION >= 0x3a0
399
+ #if PYTHON_VERSION >= 0x3a0 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_FREELIST_ALL)
400
400
  #define NUITKA_DICT_HAS_FREELIST 1
401
401
 
402
402
  // Replacement for PyDict_New that is faster
@@ -86,6 +86,9 @@ extern PyObject *IMPORT_HARD_SYS(void);
86
86
  /* C helper for hard import of module "sysconfig" import. */
87
87
  extern PyObject *IMPORT_HARD_SYSCONFIG(void);
88
88
 
89
+ /* C helper for hard import of module "tensorflow" import. */
90
+ extern PyObject *IMPORT_HARD_TENSORFLOW(void);
91
+
89
92
  /* C helper for hard import of module "types" import. */
90
93
  extern PyObject *IMPORT_HARD_TYPES(void);
91
94
 
@@ -21,7 +21,7 @@ typedef enum {
21
21
  NUITKA_LONG_UNASSIGNED = 0,
22
22
  NUITKA_LONG_OBJECT_VALID = 1,
23
23
  NUITKA_LONG_VALUE_VALID = 2,
24
- NUITKA_LONG_BOTH_VALID = 3
24
+ NUITKA_LONG_BOTH_VALID = 3 // NUITKA_LONG_VALUE_VALID | NUITKA_LONG_OBJECT_VALID
25
25
  } nuitka_long_validity;
26
26
 
27
27
  typedef struct {
@@ -58,6 +58,19 @@ NUITKA_MAY_BE_UNUSED static void ENFORCE_ILONG_OBJECT_VALUE(nuitka_ilong *value)
58
58
 
59
59
  #endif
60
60
 
61
+ #if PYTHON_VERSION < 0x3c0
62
+ // Convert single digit to sdigit (int32_t)
63
+ typedef long medium_result_value_t;
64
+ #define MEDIUM_VALUE(x) \
65
+ (Py_SIZE(x) < 0 ? -(sdigit)((PyLongObject *)(x))->ob_digit[0] \
66
+ : (Py_SIZE(x) == 0 ? (sdigit)0 : (sdigit)((PyLongObject *)(x))->ob_digit[0]))
67
+
68
+ #else
69
+ typedef stwodigits medium_result_value_t;
70
+ #define MEDIUM_VALUE(x) ((stwodigits)_PyLong_CompactValue((PyLongObject *)x))
71
+
72
+ #endif
73
+
61
74
  // TODO: Use this from header files, although they have changed.
62
75
  #define NUITKA_STATIC_SMALLINT_VALUE_MIN -5
63
76
  #define NUITKA_STATIC_SMALLINT_VALUE_MAX 257
@@ -81,7 +94,7 @@ NUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_Long_GetSmallValue(int ival)
81
94
  #endif
82
95
 
83
96
  #else
84
- NUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_Long_GetSmallValue(int ival) {
97
+ NUITKA_MAY_BE_UNUSED static inline PyObject *Nuitka_Long_GetSmallValue(medium_result_value_t ival) {
85
98
  return (PyObject *)&_PyLong_SMALL_INTS[NUITKA_TO_SMALL_VALUE_OFFSET(ival)];
86
99
  }
87
100
  #endif
@@ -27,10 +27,13 @@ extern PyObject *MAKE_LIST_EMPTY(Py_ssize_t size);
27
27
  extern bool LIST_EXTEND_FROM_ITERABLE(PyThreadState *tstate, PyObject *list, PyObject *other);
28
28
  extern bool LIST_EXTEND_FOR_UNPACK(PyThreadState *tstate, PyObject *list, PyObject *other);
29
29
 
30
- // Like PyList_Append, but we get to specify the transfer of refcount ownership.
30
+ // Like "PyList_Append", but we get to specify the transfer of refcount ownership.
31
31
  extern bool LIST_APPEND1(PyObject *target, PyObject *item);
32
32
  extern bool LIST_APPEND0(PyObject *target, PyObject *item);
33
33
 
34
+ // Like "list.remove"
35
+ bool LIST_REMOVE(PyObject *target, PyObject *item);
36
+
34
37
  // Like list.clear
35
38
  extern void LIST_CLEAR(PyObject *target);
36
39
 
@@ -65,6 +65,18 @@ extern void RAISE_EXCEPTION_WITH_TRACEBACK(PyThreadState *tstate, PyObject **exc
65
65
 
66
66
  extern bool RERAISE_EXCEPTION(PyObject **exception_type, PyObject **exception_value, PyTracebackObject **exception_tb);
67
67
 
68
+ extern void RAISE_CURRENT_EXCEPTION_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name,
69
+ PyObject **exception_type, PyObject **exception_value);
70
+
71
+ #if PYTHON_VERSION < 0x340
72
+ extern void RAISE_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR(PyThreadState *tstate, PyObject *variable_name,
73
+ PyObject **exception_type, PyObject **exception_value);
74
+ #endif
75
+
76
+ extern void RAISE_EXCEPTION_WITH_CAUSE_STATE(PyThreadState *tstate,
77
+ struct Nuitka_ExceptionPreservationItem *exception_state,
78
+ PyObject *exception_cause);
79
+
68
80
  #endif
69
81
 
70
82
  // Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -11,14 +11,18 @@
11
11
  PyTuple_SET_ITEM(tuple, index, tmp); \
12
12
  }
13
13
 
14
- #if PYTHON_VERSION >= 0x3a0
14
+ #if PYTHON_VERSION >= 0x3a0 && !defined(_NUITKA_EXPERIMENTAL_DISABLE_FREELIST_ALL)
15
15
  #define NUITKA_TUPLE_HAS_FREELIST 1
16
+ // Make empty tuple, size > 0
16
17
  extern PyObject *MAKE_TUPLE_EMPTY(Py_ssize_t size);
18
+ // Make empty tuple, size >= 0
17
19
  extern PyObject *MAKE_TUPLE_EMPTY_VAR(Py_ssize_t size);
18
20
  #else
19
21
  #define NUITKA_TUPLE_HAS_FREELIST 0
20
22
 
23
+ // Make empty tuple, size > 0
21
24
  #define MAKE_TUPLE_EMPTY(size) PyTuple_New(size)
25
+ // Make empty tuple, size >= 0
22
26
  #define MAKE_TUPLE_EMPTY_VAR(size) PyTuple_New(size)
23
27
  #endif
24
28
 
@@ -420,6 +420,10 @@ extern void Nuitka_PyType_Ready(PyTypeObject *type, PyTypeObject *base, bool gen
420
420
  #include "nuitka/exception_groups.h"
421
421
  #endif
422
422
 
423
+ #if PYTHON_VERSION >= 0x3c0
424
+ #include "nuitka/type_aliases.h"
425
+ #endif
426
+
423
427
  #endif
424
428
 
425
429
  // Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -91,13 +91,12 @@ NUITKA_MAY_BE_UNUSED static bool Nuitka_SetModuleString(char const *module_name,
91
91
  NUITKA_MAY_BE_UNUSED static bool Nuitka_DelModule(PyThreadState *tstate, PyObject *module_name) {
92
92
  CHECK_OBJECT(module_name);
93
93
 
94
- PyObject *save_exception_type, *save_exception_value;
95
- PyTracebackObject *save_exception_tb;
96
- FETCH_ERROR_OCCURRED(tstate, &save_exception_type, &save_exception_value, &save_exception_tb);
94
+ struct Nuitka_ExceptionPreservationItem saved_exception_state;
95
+ FETCH_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);
97
96
 
98
97
  bool result = DICT_REMOVE_ITEM(PyImport_GetModuleDict(), module_name);
99
98
 
100
- RESTORE_ERROR_OCCURRED(tstate, save_exception_type, save_exception_value, save_exception_tb);
99
+ RESTORE_ERROR_OCCURRED_STATE(tstate, &saved_exception_state);
101
100
 
102
101
  return result;
103
102
  }
@@ -0,0 +1,25 @@
1
+ // Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+ #ifndef __NUITKA_JIT_SOURCES_H__
4
+ #define __NUITKA_JIT_SOURCES_H__
5
+
6
+ // Helpers for making source available at run-time for JIT systems
7
+ // outside of Nuitka that want it.
8
+
9
+ extern void SET_UNCOMPILED_FUNCTION_SOURCE_DICT(PyObject *name, PyObject *source);
10
+
11
+ #endif
12
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
13
+ // integrates with CPython, but also works on its own.
14
+ //
15
+ // Licensed under the Apache License, Version 2.0 (the "License");
16
+ // you may not use this file except in compliance with the License.
17
+ // You may obtain a copy of the License at
18
+ //
19
+ // http://www.apache.org/licenses/LICENSE-2.0
20
+ //
21
+ // Unless required by applicable law or agreed to in writing, software
22
+ // distributed under the License is distributed on an "AS IS" BASIS,
23
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ // See the License for the specific language governing permissions and
25
+ // limitations under the License.
@@ -51,9 +51,19 @@
51
51
  #include "pydebug.h"
52
52
  #endif
53
53
 
54
+ /* A way to not give warnings about things that are declared, but might not
55
+ * be used like in-line helper functions in headers or static per module
56
+ * variables from headers.
57
+ */
58
+ #ifdef __GNUC__
59
+ #define NUITKA_MAY_BE_UNUSED __attribute__((__unused__))
60
+ #else
61
+ #define NUITKA_MAY_BE_UNUSED
62
+ #endif
63
+
54
64
  // We are not following the 3.10 change to an inline function. At least
55
65
  // not immediately.
56
- #if PYTHON_VERSION >= 0x3a0
66
+ #if PYTHON_VERSION >= 0x3a0 && PYTHON_VERSION < 0x3c0
57
67
  #undef Py_REFCNT
58
68
  #define Py_REFCNT(ob) (_PyObject_CAST(ob)->ob_refcnt)
59
69
  #endif
@@ -89,6 +99,26 @@
89
99
 
90
100
  extern _PyRuntimeState _PyRuntime;
91
101
  #else
102
+
103
+ #if PYTHON_VERSION >= 0x3c0
104
+ #include "internal/pycore_runtime.h"
105
+ #include "internal/pycore_typevarobject.h"
106
+
107
+ static inline size_t Nuitka_static_builtin_index_get(PyTypeObject *self) { return (size_t)self->tp_subclasses - 1; }
108
+
109
+ static inline static_builtin_state *Nuitka_static_builtin_state_get(PyInterpreterState *interp, PyTypeObject *self) {
110
+ return &(interp->types.builtins[Nuitka_static_builtin_index_get(self)]);
111
+ }
112
+
113
+ NUITKA_MAY_BE_UNUSED static inline static_builtin_state *Nuitka_PyStaticType_GetState(PyInterpreterState *interp,
114
+ PyTypeObject *self) {
115
+ assert(self->tp_flags & _Py_TPFLAGS_STATIC_BUILTIN);
116
+ return Nuitka_static_builtin_state_get(interp, self);
117
+ }
118
+
119
+ #define _PyStaticType_GetState(interp, self) Nuitka_PyStaticType_GetState(interp, self)
120
+ #endif
121
+
92
122
  #include "internal/pycore_pystate.h"
93
123
  #endif
94
124
 
@@ -178,16 +208,6 @@ extern _PyRuntimeState _PyRuntime;
178
208
 
179
209
  #define NUITKA_NO_RETURN HEDLEY_NO_RETURN
180
210
 
181
- /* A way to not give warnings about things that are declared, but might not
182
- * be used like in-line helper functions in headers or static per module
183
- * variables from headers.
184
- */
185
- #ifdef __GNUC__
186
- #define NUITKA_MAY_BE_UNUSED __attribute__((__unused__))
187
- #else
188
- #define NUITKA_MAY_BE_UNUSED
189
- #endif
190
-
191
211
  /* This is used to indicate code control flows we know cannot happen. */
192
212
  #ifndef __NUITKA_NO_ASSERT__
193
213
  #define NUITKA_CANNOT_GET_HERE(NAME) \
@@ -399,6 +419,11 @@ extern PyThreadState *_PyThreadState_Current;
399
419
  #define NuitkaType_HasFeatureClass(descr) (1)
400
420
  #endif
401
421
 
422
+ // For newer Python, this API was moved to global state
423
+ #if PYTHON_VERSION >= 0x3c0
424
+ #define _Py_PackageContext (_PyRuntime.imports.pkgcontext)
425
+ #endif
426
+
402
427
  // Our replacement for "PyType_IsSubtype"
403
428
  extern bool Nuitka_Type_IsSubtype(PyTypeObject *a, PyTypeObject *b);
404
429
 
@@ -447,6 +472,8 @@ extern PyObject *Nuitka_dunder_compiled_value;
447
472
  #include "nuitka/filesystem_paths.h"
448
473
  #include "nuitka/safe_string_ops.h"
449
474
 
475
+ #include "nuitka/jit_sources.h"
476
+
450
477
  #if _NUITKA_EXPERIMENTAL_WRITEABLE_CONSTANTS
451
478
  #include "nuitka_data_decoder.h"
452
479
  #else
@@ -34,9 +34,12 @@ extern void PRINT_TRACEBACK(PyTracebackObject *traceback);
34
34
  #if PYTHON_VERSION < 0x3b0
35
35
  #define PRINT_EXCEPTION(exception_type, exception_value, exception_tb) \
36
36
  _PRINT_EXCEPTION(exception_type, exception_value, exception_tb)
37
+ #define PRINT_EXCEPTION_STATE(exception_state) \
38
+ _PRINT_EXCEPTION(exception_state->exception_type, exception_state->exception_value, exception_state->exception_tb)
37
39
  extern void _PRINT_EXCEPTION(PyObject *exception_type, PyObject *exception_value, PyTracebackObject *exception_tb);
38
40
  #else
39
41
  #define PRINT_EXCEPTION(exception_type, exception_value, exception_tb) _PRINT_EXCEPTION(exception_value)
42
+ #define PRINT_EXCEPTION_STATE(exception_state) _PRINT_EXCEPTION((exception_state)->exception_value)
40
43
  extern void _PRINT_EXCEPTION(PyObject *exception_value);
41
44
  #endif
42
45
 
@@ -63,9 +63,7 @@ NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate
63
63
  PyObject *async_exc = tstate->async_exc;
64
64
  tstate->async_exc = NULL;
65
65
 
66
- Py_INCREF(async_exc);
67
-
68
- RESTORE_ERROR_OCCURRED(tstate, async_exc, NULL, NULL);
66
+ SET_CURRENT_EXCEPTION_TYPE0(tstate, async_exc);
69
67
 
70
68
  return false;
71
69
  }
@@ -98,9 +96,7 @@ NUITKA_MAY_BE_UNUSED static inline bool CONSIDER_THREADING(PyThreadState *tstate
98
96
  PyObject *async_exc = tstate->async_exc;
99
97
  tstate->async_exc = NULL;
100
98
 
101
- Py_INCREF(async_exc);
102
-
103
- RESTORE_ERROR_OCCURRED(tstate, async_exc, NULL, NULL);
99
+ SET_CURRENT_EXCEPTION_TYPE0(tstate, async_exc);
104
100
 
105
101
  return false;
106
102
  }
@@ -0,0 +1,27 @@
1
+ // Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+ #ifndef __NUITKA_TYPE_ALIASES_H__
4
+ #define __NUITKA_TYPE_ALIASES_H__
5
+
6
+ /* This file is included from another C file, help IDEs to still parse it on its own. */
7
+ #ifdef __IDE_ONLY__
8
+ #include "nuitka/prelude.h"
9
+ #endif
10
+
11
+ extern PyObject *MAKE_TYPE_ALIAS(PyObject *name, PyObject *type_params, PyObject *compute_value);
12
+
13
+ #endif
14
+ // Part of "Nuitka", an optimizing Python compiler that is compatible and
15
+ // integrates with CPython, but also works on its own.
16
+ //
17
+ // Licensed under the Apache License, Version 2.0 (the "License");
18
+ // you may not use this file except in compliance with the License.
19
+ // You may obtain a copy of the License at
20
+ //
21
+ // http://www.apache.org/licenses/LICENSE-2.0
22
+ //
23
+ // Unless required by applicable law or agreed to in writing, software
24
+ // distributed under the License is distributed on an "AS IS" BASIS,
25
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ // See the License for the specific language governing permissions and
27
+ // limitations under the License.
@@ -2188,8 +2188,6 @@ def resolve_egg_link(path):
2188
2188
  return next(dist_groups, ())
2189
2189
 
2190
2190
 
2191
- register_finder(pkgutil.ImpImporter, find_on_path)
2192
-
2193
2191
  if hasattr(importlib_machinery, 'FileFinder'):
2194
2192
  register_finder(importlib_machinery.FileFinder, find_on_path)
2195
2193
 
@@ -2339,7 +2337,6 @@ def file_ns_handler(importer, path_item, packageName, module):
2339
2337
  return subpath
2340
2338
 
2341
2339
 
2342
- register_namespace_handler(pkgutil.ImpImporter, file_ns_handler)
2343
2340
  register_namespace_handler(zipimport.zipimporter, file_ns_handler)
2344
2341
 
2345
2342
  if hasattr(importlib_machinery, 'FileFinder'):
@@ -1,5 +1,2 @@
1
1
  """`tqdm` version detector. Precedence: installed dist, git, 'UNKNOWN'."""
2
- try:
3
- from ._dist_ver import __version__
4
- except ImportError:
5
- __version__ = "UNKNOWN"
2
+ __version__ = "UNKNOWN"