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
@@ -278,7 +278,7 @@ static PyObject *Nuitka_PyGen_Send(PyThreadState *tstate, PyGenObject *gen, PyOb
278
278
  #endif
279
279
 
280
280
  // Now release frame.
281
- #if PYTHON_VERSION >= 0x340
281
+ #if PYTHON_VERSION >= 0x300
282
282
  gen->gi_frame->f_gen = NULL;
283
283
  #endif
284
284
  gen->gi_frame = NULL;
@@ -331,7 +331,7 @@ static PyObject *Nuitka_PyGen_Send(PyThreadState *tstate, PyGenObject *gen, PyOb
331
331
  // Not done for earlier versions yet, indicate usability for compiled
332
332
  // generators, but it seems that mostly coroutines need it anyway, so the
333
333
  // benefit would be only for performance and not by a lot.
334
- #if PYTHON_VERSION >= 0x340 && PYTHON_VERSION < 0x3d0
334
+ #if PYTHON_VERSION >= 0x300 && PYTHON_VERSION < 0x3d0
335
335
  #define NUITKA_UNCOMPILED_THROW_INTEGRATION 1
336
336
  #endif
337
337
 
@@ -243,16 +243,17 @@ static PyObject *Nuitka_Method_tp_call(struct Nuitka_MethodObject *method, PyObj
243
243
  }
244
244
  }
245
245
 
246
- static PyObject *Nuitka_Method_tp_descr_get(struct Nuitka_MethodObject *method, PyObject *object, PyObject *klass) {
246
+ static PyObject *Nuitka_Method_tp_descr_get(struct Nuitka_MethodObject *method, PyObject *object,
247
+ PyObject *class_object) {
247
248
  // Don't rebind already bound methods.
248
249
  if (method->m_object != NULL) {
249
250
  Py_INCREF(method);
250
251
  return (PyObject *)method;
251
252
  }
252
253
 
253
- if (method->m_class != NULL && klass != NULL) {
254
+ if (method->m_class != NULL && class_object != NULL) {
254
255
  // Quick subclass test, bound methods remain the same if the class is a sub class
255
- int result = PyObject_IsSubclass(klass, method->m_class);
256
+ int result = PyObject_IsSubclass(class_object, method->m_class);
256
257
 
257
258
  if (unlikely(result < 0)) {
258
259
  return NULL;
@@ -262,7 +263,7 @@ static PyObject *Nuitka_Method_tp_descr_get(struct Nuitka_MethodObject *method,
262
263
  }
263
264
  }
264
265
 
265
- return Nuitka_Method_New(method->m_function, object, klass);
266
+ return Nuitka_Method_New(method->m_function, object, class_object);
266
267
  }
267
268
 
268
269
  static PyObject *Nuitka_Method_tp_getattro(struct Nuitka_MethodObject *method, PyObject *name) {
@@ -446,13 +447,13 @@ static void Nuitka_Method_tp_dealloc(struct Nuitka_MethodObject *method) {
446
447
  static PyObject *Nuitka_Method_tp_new(PyTypeObject *type, PyObject *args, PyObject *kw) {
447
448
  PyObject *func;
448
449
  PyObject *self;
449
- PyObject *klass = NULL;
450
+ PyObject *class_object = NULL;
450
451
 
451
452
  if (!_PyArg_NoKeywords("compiled_method", kw)) {
452
453
  return NULL;
453
454
  }
454
455
 
455
- if (!PyArg_UnpackTuple(args, "compiled_method", 2, 3, &func, &self, &klass)) {
456
+ if (!PyArg_UnpackTuple(args, "compiled_method", 2, 3, &func, &self, &class_object)) {
456
457
  return NULL;
457
458
  }
458
459
 
@@ -469,7 +470,7 @@ static PyObject *Nuitka_Method_tp_new(PyTypeObject *type, PyObject *args, PyObje
469
470
  self = NULL;
470
471
  }
471
472
 
472
- if (self == NULL && klass == NULL) {
473
+ if (self == NULL && class_object == NULL) {
473
474
  PyThreadState *tstate = PyThreadState_GET();
474
475
 
475
476
  SET_CURRENT_EXCEPTION_TYPE0_STR(tstate, PyExc_TypeError, "unbound methods must have non-NULL im_class");
@@ -477,7 +478,7 @@ static PyObject *Nuitka_Method_tp_new(PyTypeObject *type, PyObject *args, PyObje
477
478
  }
478
479
 
479
480
  if (Nuitka_Method_Check(func)) {
480
- return Nuitka_Method_New(((struct Nuitka_MethodObject *)func)->m_function, self, klass);
481
+ return Nuitka_Method_New(((struct Nuitka_MethodObject *)func)->m_function, self, class_object);
481
482
  }
482
483
 
483
484
  if (Nuitka_Function_Check(func) == false) {
@@ -485,7 +486,7 @@ static PyObject *Nuitka_Method_tp_new(PyTypeObject *type, PyObject *args, PyObje
485
486
  return NULL;
486
487
  }
487
488
 
488
- return Nuitka_Method_New((struct Nuitka_FunctionObject *)func, self, klass);
489
+ return Nuitka_Method_New((struct Nuitka_FunctionObject *)func, self, class_object);
489
490
  }
490
491
 
491
492
  PyTypeObject Nuitka_Method_Type = {
@@ -550,7 +551,7 @@ PyTypeObject Nuitka_Method_Type = {
550
551
  0, // tp_weaklist
551
552
  0, // tp_del
552
553
  0 // tp_version_tag
553
- #if PYTHON_VERSION >= 0x340
554
+ #if PYTHON_VERSION >= 0x300
554
555
  ,
555
556
  0 /* tp_finalizer */
556
557
  #endif
@@ -560,7 +561,7 @@ void _initCompiledMethodType(void) {
560
561
  Nuitka_PyType_Ready(&Nuitka_Method_Type, &PyMethod_Type, false, true, false, false, false);
561
562
  }
562
563
 
563
- PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *klass) {
564
+ PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *object, PyObject *class_object) {
564
565
  struct Nuitka_MethodObject *result;
565
566
 
566
567
  CHECK_OBJECT((PyObject *)function);
@@ -580,8 +581,8 @@ PyObject *Nuitka_Method_New(struct Nuitka_FunctionObject *function, PyObject *ob
580
581
 
581
582
  result->m_object = object;
582
583
  Py_XINCREF(object);
583
- result->m_class = klass;
584
- Py_XINCREF(klass);
584
+ result->m_class = class_object;
585
+ Py_XINCREF(class_object);
585
586
 
586
587
  result->m_weakrefs = NULL;
587
588
 
@@ -6,25 +6,23 @@
6
6
  #include "nuitka/prelude.h"
7
7
  #endif
8
8
 
9
- // spell-checker: ignore klass
10
-
11
9
  #if PYTHON_VERSION < 0x300
12
- PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *klass, PyObject *attr_name) {
13
- CHECK_OBJECT(klass);
10
+ PyObject *FIND_ATTRIBUTE_IN_CLASS(PyClassObject *class_object, PyObject *attr_name) {
11
+ CHECK_OBJECT(class_object);
14
12
  CHECK_OBJECT(attr_name);
15
13
 
16
- assert(PyClass_Check(klass));
14
+ assert(PyClass_Check(class_object));
17
15
  assert(PyString_CheckExact(attr_name));
18
16
 
19
- PyObject *result = GET_STRING_DICT_VALUE((PyDictObject *)klass->cl_dict, (PyStringObject *)attr_name);
17
+ PyObject *result = GET_STRING_DICT_VALUE((PyDictObject *)class_object->cl_dict, (PyStringObject *)attr_name);
20
18
 
21
19
  if (result == NULL) {
22
- assert(PyTuple_Check(klass->cl_bases));
20
+ assert(PyTuple_Check(class_object->cl_bases));
23
21
 
24
- Py_ssize_t base_count = PyTuple_GET_SIZE(klass->cl_bases);
22
+ Py_ssize_t base_count = PyTuple_GET_SIZE(class_object->cl_bases);
25
23
 
26
24
  for (Py_ssize_t i = 0; i < base_count; i++) {
27
- result = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)PyTuple_GET_ITEM(klass->cl_bases, i), attr_name);
25
+ result = FIND_ATTRIBUTE_IN_CLASS((PyClassObject *)PyTuple_GET_ITEM(class_object->cl_bases, i), attr_name);
28
26
 
29
27
  if (result != NULL) {
30
28
  break;
@@ -124,7 +122,7 @@ PyObject *LOOKUP_ATTRIBUTE(PyThreadState *tstate, PyObject *source, PyObject *at
124
122
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
125
123
  func = Py_TYPE(descr)->tp_descr_get;
126
124
 
127
- if (func != NULL && PyDescr_IsData(descr)) {
125
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
128
126
  PyObject *result = func(descr, source, (PyObject *)type);
129
127
  Py_DECREF(descr);
130
128
 
@@ -276,7 +274,7 @@ PyObject *LOOKUP_ATTRIBUTE_DICT_SLOT(PyThreadState *tstate, PyObject *source) {
276
274
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
277
275
  func = Py_TYPE(descr)->tp_descr_get;
278
276
 
279
- if (func != NULL && PyDescr_IsData(descr)) {
277
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
280
278
  PyObject *result = func(descr, source, (PyObject *)type);
281
279
  Py_DECREF(descr);
282
280
 
@@ -393,7 +391,7 @@ PyObject *LOOKUP_ATTRIBUTE_CLASS_SLOT(PyThreadState *tstate, PyObject *source) {
393
391
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
394
392
  func = Py_TYPE(descr)->tp_descr_get;
395
393
 
396
- if (func != NULL && PyDescr_IsData(descr)) {
394
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
397
395
  PyObject *result = func(descr, source, (PyObject *)type);
398
396
  Py_DECREF(descr);
399
397
 
@@ -558,7 +556,7 @@ bool HAS_ATTR_BOOL(PyThreadState *tstate, PyObject *source, PyObject *attr_name)
558
556
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
559
557
  func = Py_TYPE(descr)->tp_descr_get;
560
558
 
561
- if (func != NULL && PyDescr_IsData(descr)) {
559
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
562
560
  PyObject *result = func(descr, source, (PyObject *)type);
563
561
  Py_DECREF(descr);
564
562
 
@@ -727,7 +725,7 @@ int HAS_ATTR_BOOL2(PyThreadState *tstate, PyObject *source, PyObject *attr_name)
727
725
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
728
726
  func = Py_TYPE(descr)->tp_descr_get;
729
727
 
730
- if (func != NULL && PyDescr_IsData(descr)) {
728
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
731
729
  PyObject *result = func(descr, source, (PyObject *)type);
732
730
  Py_DECREF(descr);
733
731
 
@@ -929,7 +927,7 @@ static bool SET_ATTRIBUTE_GENERIC(PyThreadState *tstate, PyTypeObject *type, PyO
929
927
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
930
928
  descrsetfunc func = Py_TYPE(descr)->tp_descr_set;
931
929
 
932
- if (func != NULL && PyDescr_IsData(descr)) {
930
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
933
931
  int res = func(descr, target, value);
934
932
  Py_DECREF(descr);
935
933
 
@@ -165,10 +165,19 @@ PyObject *EVAL_CODE(PyThreadState *tstate, PyObject *code, PyObject *globals, Py
165
165
  return NULL;
166
166
  }
167
167
 
168
- // Set the __builtins__ in globals, it is expected to be present.
169
- if (PyDict_Check(globals) && DICT_HAS_ITEM(tstate, globals, const_str_plain___builtins__) == 0) {
170
- if (PyDict_SetItem(globals, const_str_plain___builtins__, (PyObject *)builtin_module) != 0) {
171
- return NULL;
168
+ // Set the "__builtins__" value in globals, it is expected to be present.
169
+ assert(builtin_module != NULL);
170
+
171
+ if (PyDict_Check(globals)) {
172
+ const int res = DICT_HAS_ITEM(tstate, globals, const_str_plain___builtins__);
173
+
174
+ if (res == 0) {
175
+ if (PyDict_SetItem(globals, const_str_plain___builtins__, (PyObject *)builtin_module) != 0) {
176
+ // Not really allowed to happen, so far this was seen only with
177
+ // C compilers getting the value of "res" wrong.
178
+ assert(false);
179
+ return NULL;
180
+ }
172
181
  }
173
182
  }
174
183
 
@@ -448,7 +457,7 @@ PyObject *BUILTIN_HASH(PyThreadState *tstate, PyObject *value) {
448
457
  }
449
458
 
450
459
  #if PYTHON_VERSION < 0x300
451
- if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {
460
+ if (likely(type->tp_compare == NULL && TP_RICHCOMPARE(type) == NULL)) {
452
461
  Py_hash_t hash = Nuitka_HashFromPointer(value);
453
462
  return PyInt_FromLong(hash);
454
463
  }
@@ -467,7 +476,7 @@ Py_hash_t HASH_VALUE_WITH_ERROR(PyThreadState *tstate, PyObject *value) {
467
476
  }
468
477
 
469
478
  #if PYTHON_VERSION < 0x300
470
- if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {
479
+ if (likely(type->tp_compare == NULL && TP_RICHCOMPARE(type) == NULL)) {
471
480
  return Nuitka_HashFromPointer(value);
472
481
  }
473
482
  #endif
@@ -490,7 +499,7 @@ Py_hash_t HASH_VALUE_WITHOUT_ERROR(PyThreadState *tstate, PyObject *value) {
490
499
  }
491
500
 
492
501
  #if PYTHON_VERSION < 0x300
493
- if (likely(type->tp_compare == NULL && RICHCOMPARE(type) == NULL)) {
502
+ if (likely(type->tp_compare == NULL && TP_RICHCOMPARE(type) == NULL)) {
494
503
  return Nuitka_HashFromPointer(value);
495
504
  }
496
505
  #endif
@@ -287,39 +287,39 @@ char const *GET_CALLABLE_DESC(PyObject *object) {
287
287
  }
288
288
  }
289
289
 
290
- char const *GET_CLASS_NAME(PyObject *klass) {
291
- if (klass == NULL) {
290
+ char const *GET_CLASS_NAME(PyObject *class_object) {
291
+ if (class_object == NULL) {
292
292
  return "?";
293
293
  } else {
294
294
  #if PYTHON_VERSION < 0x300
295
- if (PyClass_Check(klass)) {
296
- return Nuitka_String_AsString(((PyClassObject *)klass)->cl_name);
295
+ if (PyClass_Check(class_object)) {
296
+ return Nuitka_String_AsString(((PyClassObject *)class_object)->cl_name);
297
297
  }
298
298
  #endif
299
299
 
300
- if (!PyType_Check(klass)) {
301
- klass = (PyObject *)Py_TYPE(klass);
300
+ if (!PyType_Check(class_object)) {
301
+ class_object = (PyObject *)Py_TYPE(class_object);
302
302
  }
303
303
 
304
- return ((PyTypeObject *)klass)->tp_name;
304
+ return ((PyTypeObject *)class_object)->tp_name;
305
305
  }
306
306
  }
307
307
 
308
308
  char const *GET_INSTANCE_CLASS_NAME(PyThreadState *tstate, PyObject *instance) {
309
309
  // TODO: Why not use our own attribute lookup here.
310
- PyObject *klass = PyObject_GetAttr(instance, const_str_plain___class__);
310
+ PyObject *class_object = PyObject_GetAttr(instance, const_str_plain___class__);
311
311
 
312
312
  // Fallback to type as this cannot fail.
313
- if (klass == NULL) {
313
+ if (class_object == NULL) {
314
314
  CLEAR_ERROR_OCCURRED(tstate);
315
315
 
316
- klass = (PyObject *)Py_TYPE(instance);
317
- Py_INCREF(klass);
316
+ class_object = (PyObject *)Py_TYPE(instance);
317
+ Py_INCREF(class_object);
318
318
  }
319
319
 
320
- char const *result = GET_CLASS_NAME(klass);
320
+ char const *result = GET_CLASS_NAME(class_object);
321
321
 
322
- Py_DECREF(klass);
322
+ Py_DECREF(class_object);
323
323
 
324
324
  return result;
325
325
  }
@@ -11903,7 +11903,7 @@ PyObject *CALL_METHOD_NO_ARGS(PyThreadState *tstate, PyObject *source, PyObject
11903
11903
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
11904
11904
  func = Py_TYPE(descr)->tp_descr_get;
11905
11905
 
11906
- if (func != NULL && PyDescr_IsData(descr)) {
11906
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
11907
11907
  PyObject *called_object = func(descr, source, (PyObject *)type);
11908
11908
  Py_DECREF(descr);
11909
11909
 
@@ -12069,7 +12069,7 @@ PyObject *CALL_METHOD_NO_ARGS(PyThreadState *tstate, PyObject *source, PyObject
12069
12069
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12070
12070
  func = Py_TYPE(descr)->tp_descr_get;
12071
12071
 
12072
- if (func != NULL && PyDescr_IsData(descr)) {
12072
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12073
12073
  PyObject *called_object = func(descr, source, (PyObject *)type);
12074
12074
  Py_DECREF(descr);
12075
12075
 
@@ -12129,7 +12129,7 @@ PyObject *CALL_METHOD_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *source, P
12129
12129
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12130
12130
  func = Py_TYPE(descr)->tp_descr_get;
12131
12131
 
12132
- if (func != NULL && PyDescr_IsData(descr)) {
12132
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12133
12133
  PyObject *called_object = func(descr, source, (PyObject *)type);
12134
12134
  Py_DECREF(descr);
12135
12135
 
@@ -12295,7 +12295,7 @@ PyObject *CALL_METHOD_WITH_SINGLE_ARG(PyThreadState *tstate, PyObject *source, P
12295
12295
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12296
12296
  func = Py_TYPE(descr)->tp_descr_get;
12297
12297
 
12298
- if (func != NULL && PyDescr_IsData(descr)) {
12298
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12299
12299
  PyObject *called_object = func(descr, source, (PyObject *)type);
12300
12300
  Py_DECREF(descr);
12301
12301
 
@@ -12354,7 +12354,7 @@ PyObject *CALL_METHOD_WITH_ARGS2(PyThreadState *tstate, PyObject *source, PyObje
12354
12354
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12355
12355
  func = Py_TYPE(descr)->tp_descr_get;
12356
12356
 
12357
- if (func != NULL && PyDescr_IsData(descr)) {
12357
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12358
12358
  PyObject *called_object = func(descr, source, (PyObject *)type);
12359
12359
  Py_DECREF(descr);
12360
12360
 
@@ -12520,7 +12520,7 @@ PyObject *CALL_METHOD_WITH_ARGS2(PyThreadState *tstate, PyObject *source, PyObje
12520
12520
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12521
12521
  func = Py_TYPE(descr)->tp_descr_get;
12522
12522
 
12523
- if (func != NULL && PyDescr_IsData(descr)) {
12523
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12524
12524
  PyObject *called_object = func(descr, source, (PyObject *)type);
12525
12525
  Py_DECREF(descr);
12526
12526
 
@@ -12579,7 +12579,7 @@ PyObject *CALL_METHOD_WITH_ARGS3(PyThreadState *tstate, PyObject *source, PyObje
12579
12579
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12580
12580
  func = Py_TYPE(descr)->tp_descr_get;
12581
12581
 
12582
- if (func != NULL && PyDescr_IsData(descr)) {
12582
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12583
12583
  PyObject *called_object = func(descr, source, (PyObject *)type);
12584
12584
  Py_DECREF(descr);
12585
12585
 
@@ -12745,7 +12745,7 @@ PyObject *CALL_METHOD_WITH_ARGS3(PyThreadState *tstate, PyObject *source, PyObje
12745
12745
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12746
12746
  func = Py_TYPE(descr)->tp_descr_get;
12747
12747
 
12748
- if (func != NULL && PyDescr_IsData(descr)) {
12748
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12749
12749
  PyObject *called_object = func(descr, source, (PyObject *)type);
12750
12750
  Py_DECREF(descr);
12751
12751
 
@@ -12804,7 +12804,7 @@ PyObject *CALL_METHOD_WITH_ARGS4(PyThreadState *tstate, PyObject *source, PyObje
12804
12804
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12805
12805
  func = Py_TYPE(descr)->tp_descr_get;
12806
12806
 
12807
- if (func != NULL && PyDescr_IsData(descr)) {
12807
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12808
12808
  PyObject *called_object = func(descr, source, (PyObject *)type);
12809
12809
  Py_DECREF(descr);
12810
12810
 
@@ -12970,7 +12970,7 @@ PyObject *CALL_METHOD_WITH_ARGS4(PyThreadState *tstate, PyObject *source, PyObje
12970
12970
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
12971
12971
  func = Py_TYPE(descr)->tp_descr_get;
12972
12972
 
12973
- if (func != NULL && PyDescr_IsData(descr)) {
12973
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
12974
12974
  PyObject *called_object = func(descr, source, (PyObject *)type);
12975
12975
  Py_DECREF(descr);
12976
12976
 
@@ -13029,7 +13029,7 @@ PyObject *CALL_METHOD_WITH_ARGS5(PyThreadState *tstate, PyObject *source, PyObje
13029
13029
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13030
13030
  func = Py_TYPE(descr)->tp_descr_get;
13031
13031
 
13032
- if (func != NULL && PyDescr_IsData(descr)) {
13032
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13033
13033
  PyObject *called_object = func(descr, source, (PyObject *)type);
13034
13034
  Py_DECREF(descr);
13035
13035
 
@@ -13195,7 +13195,7 @@ PyObject *CALL_METHOD_WITH_ARGS5(PyThreadState *tstate, PyObject *source, PyObje
13195
13195
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13196
13196
  func = Py_TYPE(descr)->tp_descr_get;
13197
13197
 
13198
- if (func != NULL && PyDescr_IsData(descr)) {
13198
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13199
13199
  PyObject *called_object = func(descr, source, (PyObject *)type);
13200
13200
  Py_DECREF(descr);
13201
13201
 
@@ -13254,7 +13254,7 @@ PyObject *CALL_METHOD_WITH_ARGS6(PyThreadState *tstate, PyObject *source, PyObje
13254
13254
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13255
13255
  func = Py_TYPE(descr)->tp_descr_get;
13256
13256
 
13257
- if (func != NULL && PyDescr_IsData(descr)) {
13257
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13258
13258
  PyObject *called_object = func(descr, source, (PyObject *)type);
13259
13259
  Py_DECREF(descr);
13260
13260
 
@@ -13420,7 +13420,7 @@ PyObject *CALL_METHOD_WITH_ARGS6(PyThreadState *tstate, PyObject *source, PyObje
13420
13420
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13421
13421
  func = Py_TYPE(descr)->tp_descr_get;
13422
13422
 
13423
- if (func != NULL && PyDescr_IsData(descr)) {
13423
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13424
13424
  PyObject *called_object = func(descr, source, (PyObject *)type);
13425
13425
  Py_DECREF(descr);
13426
13426
 
@@ -13479,7 +13479,7 @@ PyObject *CALL_METHOD_WITH_ARGS7(PyThreadState *tstate, PyObject *source, PyObje
13479
13479
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13480
13480
  func = Py_TYPE(descr)->tp_descr_get;
13481
13481
 
13482
- if (func != NULL && PyDescr_IsData(descr)) {
13482
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13483
13483
  PyObject *called_object = func(descr, source, (PyObject *)type);
13484
13484
  Py_DECREF(descr);
13485
13485
 
@@ -13645,7 +13645,7 @@ PyObject *CALL_METHOD_WITH_ARGS7(PyThreadState *tstate, PyObject *source, PyObje
13645
13645
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13646
13646
  func = Py_TYPE(descr)->tp_descr_get;
13647
13647
 
13648
- if (func != NULL && PyDescr_IsData(descr)) {
13648
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13649
13649
  PyObject *called_object = func(descr, source, (PyObject *)type);
13650
13650
  Py_DECREF(descr);
13651
13651
 
@@ -13704,7 +13704,7 @@ PyObject *CALL_METHOD_WITH_ARGS8(PyThreadState *tstate, PyObject *source, PyObje
13704
13704
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13705
13705
  func = Py_TYPE(descr)->tp_descr_get;
13706
13706
 
13707
- if (func != NULL && PyDescr_IsData(descr)) {
13707
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13708
13708
  PyObject *called_object = func(descr, source, (PyObject *)type);
13709
13709
  Py_DECREF(descr);
13710
13710
 
@@ -13870,7 +13870,7 @@ PyObject *CALL_METHOD_WITH_ARGS8(PyThreadState *tstate, PyObject *source, PyObje
13870
13870
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13871
13871
  func = Py_TYPE(descr)->tp_descr_get;
13872
13872
 
13873
- if (func != NULL && PyDescr_IsData(descr)) {
13873
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13874
13874
  PyObject *called_object = func(descr, source, (PyObject *)type);
13875
13875
  Py_DECREF(descr);
13876
13876
 
@@ -13929,7 +13929,7 @@ PyObject *CALL_METHOD_WITH_ARGS9(PyThreadState *tstate, PyObject *source, PyObje
13929
13929
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
13930
13930
  func = Py_TYPE(descr)->tp_descr_get;
13931
13931
 
13932
- if (func != NULL && PyDescr_IsData(descr)) {
13932
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
13933
13933
  PyObject *called_object = func(descr, source, (PyObject *)type);
13934
13934
  Py_DECREF(descr);
13935
13935
 
@@ -14095,7 +14095,7 @@ PyObject *CALL_METHOD_WITH_ARGS9(PyThreadState *tstate, PyObject *source, PyObje
14095
14095
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
14096
14096
  func = Py_TYPE(descr)->tp_descr_get;
14097
14097
 
14098
- if (func != NULL && PyDescr_IsData(descr)) {
14098
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
14099
14099
  PyObject *called_object = func(descr, source, (PyObject *)type);
14100
14100
  Py_DECREF(descr);
14101
14101
 
@@ -14154,7 +14154,7 @@ PyObject *CALL_METHOD_WITH_ARGS10(PyThreadState *tstate, PyObject *source, PyObj
14154
14154
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
14155
14155
  func = Py_TYPE(descr)->tp_descr_get;
14156
14156
 
14157
- if (func != NULL && PyDescr_IsData(descr)) {
14157
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
14158
14158
  PyObject *called_object = func(descr, source, (PyObject *)type);
14159
14159
  Py_DECREF(descr);
14160
14160
 
@@ -14320,7 +14320,7 @@ PyObject *CALL_METHOD_WITH_ARGS10(PyThreadState *tstate, PyObject *source, PyObj
14320
14320
  if (NuitkaType_HasFeatureClass(Py_TYPE(descr))) {
14321
14321
  func = Py_TYPE(descr)->tp_descr_get;
14322
14322
 
14323
- if (func != NULL && PyDescr_IsData(descr)) {
14323
+ if (func != NULL && Nuitka_Descr_IsData(descr)) {
14324
14324
  PyObject *called_object = func(descr, source, (PyObject *)type);
14325
14325
  Py_DECREF(descr);
14326
14326