Nuitka-winsvc 2.4.11__cp311-cp311-win_amd64.whl → 2.5.6__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 (304) hide show
  1. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +56 -109
  2. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +304 -280
  3. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
  4. nuitka/Builtins.py +31 -0
  5. nuitka/HardImportRegistry.py +8 -0
  6. nuitka/MainControl.py +9 -4
  7. nuitka/OptionParsing.py +108 -54
  8. nuitka/Options.py +69 -13
  9. nuitka/OutputDirectories.py +7 -2
  10. nuitka/PostProcessing.py +69 -38
  11. nuitka/Progress.py +16 -1
  12. nuitka/PythonVersions.py +2 -1
  13. nuitka/Serialization.py +4 -2
  14. nuitka/Tracing.py +69 -1
  15. nuitka/Version.py +2 -2
  16. nuitka/build/Backend.scons +45 -5
  17. nuitka/build/CCompilerVersion.scons +6 -0
  18. nuitka/build/Onefile.scons +6 -0
  19. nuitka/build/SconsCaching.py +4 -0
  20. nuitka/build/SconsCompilerSettings.py +14 -3
  21. nuitka/build/SconsInterface.py +3 -0
  22. nuitka/build/SconsUtils.py +5 -0
  23. nuitka/build/include/nuitka/allocator.h +124 -1
  24. nuitka/build/include/nuitka/calling.h +6 -6
  25. nuitka/build/include/nuitka/compiled_asyncgen.h +10 -7
  26. nuitka/build/include/nuitka/compiled_frame.h +2 -1
  27. nuitka/build/include/nuitka/constants.h +8 -0
  28. nuitka/build/include/nuitka/debug_settings.h +60 -0
  29. nuitka/build/include/nuitka/exceptions.h +264 -121
  30. nuitka/build/include/nuitka/helper/attributes.h +0 -4
  31. nuitka/build/include/nuitka/helper/calling_generated.h +52 -52
  32. nuitka/build/include/nuitka/helper/comparisons_dual_eq.h +47 -0
  33. nuitka/build/include/nuitka/helper/comparisons_dual_ge.h +39 -0
  34. nuitka/build/include/nuitka/helper/comparisons_dual_gt.h +39 -0
  35. nuitka/build/include/nuitka/helper/comparisons_dual_le.h +47 -0
  36. nuitka/build/include/nuitka/helper/comparisons_dual_lt.h +47 -0
  37. nuitka/build/include/nuitka/helper/comparisons_dual_ne.h +39 -0
  38. nuitka/build/include/nuitka/helper/dictionaries.h +75 -31
  39. nuitka/build/include/nuitka/helper/ints.h +86 -37
  40. nuitka/build/include/nuitka/helper/iterators.h +82 -34
  41. nuitka/build/include/nuitka/helper/operations.h +3 -0
  42. nuitka/build/include/nuitka/helper/operations_binary_add.h +6 -0
  43. nuitka/build/include/nuitka/helper/operations_binary_dual_add.h +34 -0
  44. nuitka/build/include/nuitka/helper/operations_binary_sub.h +6 -0
  45. nuitka/build/include/nuitka/helper/operations_inplace_add.h +3 -0
  46. nuitka/build/include/nuitka/helper/operations_inplace_sub.h +3 -0
  47. nuitka/build/include/nuitka/helper/raising.h +47 -28
  48. nuitka/build/include/nuitka/helper/richcomparisons.h +7 -0
  49. nuitka/build/include/nuitka/helper/tuples.h +12 -0
  50. nuitka/build/include/nuitka/helpers.h +12 -2
  51. nuitka/build/include/nuitka/prelude.h +36 -25
  52. nuitka/build/include/nuitka/printing.h +9 -7
  53. nuitka/build/include/nuitka/threading.h +15 -1
  54. nuitka/build/include/nuitka/type_aliases.h +3 -0
  55. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  56. nuitka/build/inline_copy/stubgen/six.py +998 -0
  57. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  58. nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
  59. nuitka/build/static_src/CompiledCellType.c +6 -4
  60. nuitka/build/static_src/CompiledCodeHelpers.c +106 -40
  61. nuitka/build/static_src/CompiledCoroutineType.c +41 -31
  62. nuitka/build/static_src/CompiledFrameType.c +110 -79
  63. nuitka/build/static_src/CompiledFunctionType.c +173 -151
  64. nuitka/build/static_src/CompiledGeneratorType.c +51 -49
  65. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +433 -46
  66. nuitka/build/static_src/CompiledMethodType.c +6 -12
  67. nuitka/build/static_src/HelpersAllocator.c +266 -28
  68. nuitka/build/static_src/HelpersAttributes.c +0 -21
  69. nuitka/build/static_src/HelpersBuiltin.c +23 -14
  70. nuitka/build/static_src/HelpersCalling.c +7 -7
  71. nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
  72. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  73. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  74. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  75. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  76. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  77. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  78. nuitka/build/static_src/HelpersComparisonEq.c +18 -4
  79. nuitka/build/static_src/HelpersComparisonGe.c +18 -4
  80. nuitka/build/static_src/HelpersComparisonGt.c +18 -4
  81. nuitka/build/static_src/HelpersComparisonLe.c +18 -4
  82. nuitka/build/static_src/HelpersComparisonLt.c +18 -4
  83. nuitka/build/static_src/HelpersComparisonNe.c +18 -4
  84. nuitka/build/static_src/HelpersConsole.c +34 -8
  85. nuitka/build/static_src/HelpersConstantsBlob.c +4 -2
  86. nuitka/build/static_src/HelpersDeepcopy.c +1 -0
  87. nuitka/build/static_src/HelpersDictionaries.c +195 -36
  88. nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -107
  89. nuitka/build/static_src/HelpersExceptions.c +24 -50
  90. nuitka/build/static_src/HelpersFiles.c +79 -5
  91. nuitka/build/static_src/HelpersImport.c +13 -9
  92. nuitka/build/static_src/HelpersImportHard.c +23 -46
  93. nuitka/build/static_src/HelpersLists.c +98 -9
  94. nuitka/build/static_src/HelpersOperationBinaryAdd.c +224 -6
  95. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +3 -0
  96. nuitka/build/static_src/HelpersOperationBinaryBitand.c +5 -5
  97. nuitka/build/static_src/HelpersOperationBinaryBitor.c +5 -5
  98. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +5 -5
  99. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +8 -2
  100. nuitka/build/static_src/HelpersOperationBinaryDualAdd.c +172 -0
  101. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +14 -8
  102. nuitka/build/static_src/HelpersOperationBinaryLshift.c +36 -36
  103. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +1 -0
  104. nuitka/build/static_src/HelpersOperationBinaryMod.c +22 -10
  105. nuitka/build/static_src/HelpersOperationBinaryMult.c +17 -7
  106. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +14 -8
  107. nuitka/build/static_src/HelpersOperationBinaryPow.c +24 -24
  108. nuitka/build/static_src/HelpersOperationBinaryRshift.c +4 -4
  109. nuitka/build/static_src/HelpersOperationBinarySub.c +229 -8
  110. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +8 -2
  111. nuitka/build/static_src/HelpersOperationInplaceAdd.c +162 -10
  112. nuitka/build/static_src/HelpersOperationInplaceBitand.c +5 -5
  113. nuitka/build/static_src/HelpersOperationInplaceBitor.c +5 -5
  114. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +5 -5
  115. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +11 -6
  116. nuitka/build/static_src/HelpersOperationInplaceLshift.c +20 -20
  117. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +1 -0
  118. nuitka/build/static_src/HelpersOperationInplaceMod.c +11 -6
  119. nuitka/build/static_src/HelpersOperationInplaceMult.c +11 -6
  120. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +11 -6
  121. nuitka/build/static_src/HelpersOperationInplacePow.c +20 -20
  122. nuitka/build/static_src/HelpersOperationInplaceRshift.c +4 -4
  123. nuitka/build/static_src/HelpersOperationInplaceSub.c +163 -10
  124. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +6 -1
  125. nuitka/build/static_src/HelpersProfiling.c +1 -1
  126. nuitka/build/static_src/HelpersRaising.c +255 -310
  127. nuitka/build/static_src/HelpersStrings.c +1 -1
  128. nuitka/build/static_src/HelpersTuples.c +2 -2
  129. nuitka/build/static_src/HelpersTypes.c +98 -2
  130. nuitka/build/static_src/MainProgram.c +132 -28
  131. nuitka/build/static_src/MetaPathBasedLoader.c +18 -19
  132. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +134 -11
  133. nuitka/build/static_src/OnefileBootstrap.c +6 -1
  134. nuitka/code_generation/AsyncgenCodes.py +2 -6
  135. nuitka/code_generation/BinaryOperationHelperDefinitions.py +269 -167
  136. nuitka/code_generation/BuiltinCodes.py +9 -1
  137. nuitka/code_generation/CallCodes.py +16 -16
  138. nuitka/code_generation/CodeGeneration.py +14 -2
  139. nuitka/code_generation/CodeHelperSelection.py +1 -1
  140. nuitka/code_generation/CodeHelpers.py +4 -1
  141. nuitka/code_generation/CodeObjectCodes.py +2 -2
  142. nuitka/code_generation/ComparisonCodes.py +13 -2
  143. nuitka/code_generation/ComparisonHelperDefinitions.py +23 -8
  144. nuitka/code_generation/Contexts.py +28 -16
  145. nuitka/code_generation/CoroutineCodes.py +2 -6
  146. nuitka/code_generation/DictCodes.py +3 -3
  147. nuitka/code_generation/ErrorCodes.py +34 -50
  148. nuitka/code_generation/ExceptionCodes.py +165 -96
  149. nuitka/code_generation/ExpressionCTypeSelectionHelpers.py +25 -10
  150. nuitka/code_generation/FrameCodes.py +4 -11
  151. nuitka/code_generation/FunctionCodes.py +2 -6
  152. nuitka/code_generation/GeneratorCodes.py +2 -6
  153. nuitka/code_generation/GlobalConstants.py +8 -2
  154. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  155. nuitka/code_generation/IteratorCodes.py +67 -54
  156. nuitka/code_generation/LineNumberCodes.py +1 -3
  157. nuitka/code_generation/ModuleCodes.py +28 -4
  158. nuitka/code_generation/OperationCodes.py +51 -20
  159. nuitka/code_generation/PackageResourceCodes.py +37 -0
  160. nuitka/code_generation/RaisingCodes.py +164 -90
  161. nuitka/code_generation/Reports.py +13 -5
  162. nuitka/code_generation/ReturnCodes.py +2 -16
  163. nuitka/code_generation/TryCodes.py +12 -24
  164. nuitka/code_generation/TypeAliasCodes.py +48 -0
  165. nuitka/code_generation/VariableCodes.py +99 -40
  166. nuitka/code_generation/VariableDeclarations.py +8 -8
  167. nuitka/code_generation/YieldCodes.py +1 -1
  168. nuitka/code_generation/c_types/CTypeBases.py +10 -2
  169. nuitka/code_generation/c_types/CTypeModuleDictVariables.py +3 -0
  170. nuitka/code_generation/c_types/CTypeNuitkaBooleans.py +3 -4
  171. nuitka/code_generation/c_types/CTypeNuitkaInts.py +70 -25
  172. nuitka/code_generation/c_types/CTypeNuitkaVoids.py +1 -1
  173. nuitka/code_generation/c_types/CTypePyObjectPointers.py +16 -6
  174. nuitka/code_generation/templates/CodeTemplatesAsyncgens.py +2 -2
  175. nuitka/code_generation/templates/CodeTemplatesConstants.py +11 -3
  176. nuitka/code_generation/templates/CodeTemplatesCoroutines.py +2 -2
  177. nuitka/code_generation/templates/CodeTemplatesExceptions.py +15 -16
  178. nuitka/code_generation/templates/CodeTemplatesFrames.py +18 -10
  179. nuitka/code_generation/templates/CodeTemplatesFunction.py +2 -2
  180. nuitka/code_generation/templates/CodeTemplatesGeneratorFunction.py +2 -2
  181. nuitka/code_generation/templates/CodeTemplatesIterators.py +1 -35
  182. nuitka/code_generation/templates/CodeTemplatesModules.py +34 -4
  183. nuitka/code_generation/templates/CodeTemplatesVariables.py +76 -0
  184. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +3 -3
  185. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +3 -3
  186. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -106
  187. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -2
  188. nuitka/code_generation/templates_c/HelperLongTools.c.j2 +1 -1
  189. nuitka/code_generation/templates_c/HelperOperationBinaryDual.c.j2 +115 -0
  190. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +9 -9
  191. nuitka/code_generation/templates_c/HelperOperationComparisonDual.c.j2 +86 -0
  192. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +1 -1
  193. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +1 -1
  194. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +9 -9
  195. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +7 -7
  196. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +9 -9
  197. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  198. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +4 -4
  199. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +1 -1
  200. nuitka/code_generation/templates_c/HelperSlotsInt.c.j2 +31 -31
  201. nuitka/code_generation/templates_c/HelperSlotsLong.c.j2 +1 -1
  202. nuitka/containers/Namedtuples.py +6 -0
  203. nuitka/containers/OrderedSets.py +105 -5
  204. nuitka/distutils/Build.py +14 -0
  205. nuitka/distutils/DistutilCommands.py +50 -10
  206. nuitka/finalizations/Finalization.py +3 -3
  207. nuitka/finalizations/FinalizeMarkups.py +10 -14
  208. nuitka/freezer/DependsExe.py +5 -2
  209. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  210. nuitka/freezer/DllDependenciesWin32.py +26 -12
  211. nuitka/freezer/ImportDetection.py +6 -0
  212. nuitka/freezer/IncludedDataFiles.py +37 -6
  213. nuitka/freezer/Onefile.py +1 -0
  214. nuitka/freezer/Standalone.py +72 -18
  215. nuitka/importing/Importing.py +33 -6
  216. nuitka/importing/Recursion.py +5 -2
  217. nuitka/importing/StandardLibrary.py +57 -59
  218. nuitka/nodes/AsyncgenNodes.py +3 -6
  219. nuitka/nodes/BuiltinIteratorNodes.py +2 -2
  220. nuitka/nodes/BuiltinRefNodes.py +14 -30
  221. nuitka/nodes/ChildrenHavingMixins.py +439 -46
  222. nuitka/nodes/ConditionalNodes.py +3 -2
  223. nuitka/nodes/CoroutineNodes.py +3 -6
  224. nuitka/nodes/DictionaryNodes.py +1 -1
  225. nuitka/nodes/ExceptionNodes.py +102 -26
  226. nuitka/nodes/ExpressionBasesGenerated.py +288 -4
  227. nuitka/nodes/FrameNodes.py +22 -11
  228. nuitka/nodes/FunctionNodes.py +3 -3
  229. nuitka/nodes/GeneratorNodes.py +3 -6
  230. nuitka/nodes/HardImportNodesGenerated.py +182 -0
  231. nuitka/nodes/ImportNodes.py +2 -2
  232. nuitka/nodes/NodeBases.py +28 -1
  233. nuitka/nodes/NodeMakingHelpers.py +71 -50
  234. nuitka/nodes/OperatorNodesUnary.py +128 -3
  235. nuitka/nodes/OsSysNodes.py +37 -6
  236. nuitka/nodes/OutlineNodes.py +2 -2
  237. nuitka/nodes/StatementBasesGenerated.py +0 -2
  238. nuitka/nodes/StatementNodes.py +8 -7
  239. nuitka/nodes/SubscriptNodes.py +1 -1
  240. nuitka/nodes/TypeNodes.py +28 -1
  241. nuitka/nodes/VariableAssignNodes.py +2 -1
  242. nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
  243. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  244. nuitka/nodes/shapes/ShapeMixins.py +18 -0
  245. nuitka/nodes/shapes/StandardShapes.py +47 -44
  246. nuitka/optimizations/BytecodeDemotion.py +2 -1
  247. nuitka/plugins/PluginBase.py +64 -22
  248. nuitka/plugins/Plugins.py +16 -3
  249. nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
  250. nuitka/plugins/standard/DllFilesPlugin.py +78 -2
  251. nuitka/plugins/standard/ImplicitImports.py +5 -15
  252. nuitka/plugins/standard/KivyPlugin.py +3 -12
  253. nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
  254. nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
  255. nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
  256. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  257. nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
  258. nuitka/plugins/standard/TkinterPlugin.py +23 -3
  259. nuitka/plugins/standard/TransformersPlugin.py +70 -275
  260. nuitka/plugins/standard/standard.nuitka-package.config.yml +413 -30
  261. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
  262. nuitka/reports/CompilationReportReader.py +12 -0
  263. nuitka/reports/Reports.py +11 -0
  264. nuitka/specs/BuiltinParameterSpecs.py +5 -1
  265. nuitka/specs/HardImportSpecs.py +7 -0
  266. nuitka/specs/ParameterSpecs.py +4 -4
  267. nuitka/tools/environments/Virtualenv.py +13 -5
  268. nuitka/tools/general/dll_report/__main__.py +10 -1
  269. nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
  270. nuitka/tools/podman/__main__.py +4 -2
  271. nuitka/tools/specialize/CTypeDescriptions.py +158 -9
  272. nuitka/tools/specialize/SpecializeC.py +218 -56
  273. nuitka/tools/testing/Common.py +69 -62
  274. nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
  275. nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
  276. nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
  277. nuitka/tools/watch/AutoStage.py +1 -0
  278. nuitka/tree/Building.py +10 -37
  279. nuitka/tree/ComplexCallHelperFunctions.py +4 -0
  280. nuitka/tree/ReformulationAssertStatements.py +31 -14
  281. nuitka/tree/ReformulationAssignmentStatements.py +5 -1
  282. nuitka/tree/ReformulationClasses3.py +94 -19
  283. nuitka/tree/ReformulationDictionaryCreation.py +1 -0
  284. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  285. nuitka/tree/ReformulationMatchStatements.py +3 -1
  286. nuitka/tree/ReformulationYieldExpressions.py +23 -5
  287. nuitka/utils/CommandLineOptions.py +27 -3
  288. nuitka/utils/Download.py +2 -2
  289. nuitka/utils/Execution.py +36 -31
  290. nuitka/utils/FileOperations.py +18 -39
  291. nuitka/utils/Hashing.py +5 -1
  292. nuitka/utils/Importing.py +2 -14
  293. nuitka/utils/InlineCopies.py +52 -0
  294. nuitka/utils/InstalledPythons.py +9 -4
  295. nuitka/utils/Json.py +2 -2
  296. nuitka/utils/PackageResources.py +44 -0
  297. nuitka/utils/SharedLibraries.py +24 -0
  298. nuitka/utils/Signing.py +9 -1
  299. nuitka/utils/Utils.py +1 -0
  300. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
  301. {Nuitka_winsvc-2.4.11.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
  302. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
  303. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
  304. {Nuitka_winsvc-2.4.11.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
@@ -5,18 +5,22 @@
5
5
 
6
6
  import os
7
7
 
8
- from .BuiltinRefNodes import ExpressionBuiltinExceptionRef
9
8
  from .ConstantRefNodes import makeConstantRefNode
10
- from .ExceptionNodes import ExpressionRaiseException
9
+ from .ExceptionNodes import (
10
+ ExpressionRaiseException,
11
+ makeBuiltinMakeExceptionNode,
12
+ )
11
13
  from .ExpressionBases import ExpressionNoSideEffectsMixin
12
14
  from .HardImportNodesGenerated import (
13
15
  ExpressionOsListdirCallBase,
16
+ ExpressionOsLstatCallBase,
14
17
  ExpressionOsPathAbspathCallBase,
15
18
  ExpressionOsPathBasenameCallBase,
16
19
  ExpressionOsPathExistsCallBase,
17
20
  ExpressionOsPathIsabsCallBase,
18
21
  ExpressionOsPathIsdirCallBase,
19
22
  ExpressionOsPathIsfileCallBase,
23
+ ExpressionOsStatCallBase,
20
24
  ExpressionOsUnameCallBase,
21
25
  )
22
26
 
@@ -155,15 +159,42 @@ class ExpressionOsListdirCall(ExpressionOsListdirCallBase):
155
159
  return self, None, None
156
160
 
157
161
 
162
+ class ExpressionOsStatCall(ExpressionOsStatCallBase):
163
+ kind = "EXPRESSION_OS_STAT_CALL"
164
+
165
+ def replaceWithCompileTimeValue(self, trace_collection):
166
+ # Nothing we can do really
167
+
168
+ trace_collection.onExceptionRaiseExit(BaseException)
169
+
170
+ return self, None, None
171
+
172
+
173
+ class ExpressionOsLstatCall(ExpressionOsLstatCallBase):
174
+ kind = "EXPRESSION_OS_LSTAT_CALL"
175
+
176
+ def replaceWithCompileTimeValue(self, trace_collection):
177
+ # Nothing we can do really
178
+
179
+ trace_collection.onExceptionRaiseExit(BaseException)
180
+
181
+ return self, None, None
182
+
183
+
158
184
  def makeExpressionSysExitCall(exit_code, source_ref):
185
+
159
186
  if exit_code is None:
160
- exit_code = makeConstantRefNode(constant=None, source_ref=source_ref)
187
+ args = ()
188
+ else:
189
+ args = (exit_code,)
161
190
 
162
191
  return ExpressionRaiseException(
163
- exception_type=ExpressionBuiltinExceptionRef(
164
- exception_name="SystemExit", source_ref=source_ref
192
+ exception_type=makeBuiltinMakeExceptionNode(
193
+ exception_name="SystemExit",
194
+ args=args,
195
+ for_raise=True,
196
+ source_ref=source_ref,
165
197
  ),
166
- exception_value=exit_code,
167
198
  source_ref=source_ref,
168
199
  )
169
200
 
@@ -139,9 +139,9 @@ class ExpressionOutlineBody(ChildHavingBodyOptionalMixin, ExpressionBase):
139
139
  if first_statement.isStatementRaiseException():
140
140
  # Exception exit was already annotated, need not repeat it.
141
141
 
142
+ assert first_statement.subnode_exception_value is None, first_statement
142
143
  result = ExpressionRaiseException(
143
144
  exception_type=first_statement.subnode_exception_type,
144
- exception_value=first_statement.subnode_exception_value,
145
145
  source_ref=first_statement.getSourceReference(),
146
146
  )
147
147
 
@@ -264,9 +264,9 @@ class ExpressionOutlineFunctionBase(ExpressionFunctionBodyBase):
264
264
  if first_statement.isStatementRaiseException():
265
265
  # Exception exit was already annotated, need not repeat it.
266
266
 
267
+ assert first_statement.subnode_exception_value is None, first_statement
267
268
  result = ExpressionRaiseException(
268
269
  exception_type=first_statement.subnode_exception_type,
269
- exception_value=first_statement.subnode_exception_value,
270
270
  source_ref=first_statement.getSourceReference(),
271
271
  )
272
272
 
@@ -690,7 +690,6 @@ class StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOp
690
690
 
691
691
  # This is generated for use in
692
692
  # StatementRaiseException
693
- # StatementRaiseExceptionImplicit
694
693
 
695
694
  def __init__(
696
695
  self,
@@ -878,7 +877,6 @@ class StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOp
878
877
 
879
878
  # Assign the names that are easier to import with a stable name.
880
879
  StatementRaiseExceptionBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin
881
- StatementRaiseExceptionImplicitBase = StatementChildrenHavingExceptionTypeExceptionValueOptionalExceptionTraceOptionalExceptionCauseOptionalOperationPostInitMixin
882
880
 
883
881
 
884
882
  class StatementChildHavingExpressionOperationAttributeNameMixin(StatementBase):
@@ -27,6 +27,10 @@ class StatementsSequenceMixin(object):
27
27
  def isStatementsSequence():
28
28
  return True
29
29
 
30
+ def computeStatement(self, trace_collection):
31
+ # Don't want to be called like this.
32
+ assert False, self
33
+
30
34
  def trimStatements(self, statement):
31
35
  assert statement.parent is self
32
36
 
@@ -119,9 +123,9 @@ class StatementsSequence(StatementsSequenceMixin, StatementsSequenceBase):
119
123
 
120
124
  named_children = ("statements|tuple+setter",)
121
125
 
122
- def computeStatement(self, trace_collection):
123
- # Don't want to be called like this.
124
- assert False, self
126
+ @staticmethod
127
+ def isStatementsSequenceButNotFrame():
128
+ return True
125
129
 
126
130
  def computeStatementsSequence(self, trace_collection):
127
131
  new_statements = []
@@ -137,10 +141,7 @@ class StatementsSequence(StatementsSequenceMixin, StatementsSequenceBase):
137
141
  new_statement = trace_collection.onStatement(statement=statement)
138
142
 
139
143
  if new_statement is not None:
140
- if (
141
- new_statement.isStatementsSequence()
142
- and not new_statement.isStatementsFrame()
143
- ):
144
+ if new_statement.isStatementsSequenceButNotFrame():
144
145
  new_statements.extend(new_statement.subnode_statements)
145
146
  else:
146
147
  new_statements.append(new_statement)
@@ -195,7 +195,7 @@ class ExpressionSubscriptLookupForUnpack(ExpressionSubscriptLookup):
195
195
  # Rewrite exceptions to correct message.
196
196
  if (
197
197
  result_node.isExpressionRaiseException()
198
- and result_node.subnode_exception_type.isExpressionBuiltinExceptionRef()
198
+ and result_node.subnode_exception_type.isExpressionBuiltinMakeException()
199
199
  and result_node.subnode_exception_type.getExceptionName() == "IndexError"
200
200
  ):
201
201
  if python_version >= 0x360:
nuitka/nodes/TypeNodes.py CHANGED
@@ -24,10 +24,14 @@ from .ChildrenHavingMixins import (
24
24
  ChildrenExpressionBuiltinSuper1Mixin,
25
25
  ChildrenExpressionBuiltinSuper2Mixin,
26
26
  ChildrenExpressionTypeAliasMixin,
27
+ ChildrenExpressionTypeMakeGenericMixin,
27
28
  ChildrenHavingInstanceClassesMixin,
28
29
  )
29
30
  from .ExpressionBases import ExpressionBase, ExpressionBuiltinSingleArgBase
30
- from .ExpressionBasesGenerated import ExpressionSubtypeCheckBase
31
+ from .ExpressionBasesGenerated import (
32
+ ExpressionSubtypeCheckBase,
33
+ ExpressionTypeVariableBase,
34
+ )
31
35
  from .ExpressionShapeMixins import ExpressionBoolShapeExactMixin
32
36
  from .NodeBases import SideEffectsFromChildrenMixin
33
37
  from .NodeMakingHelpers import (
@@ -347,6 +351,29 @@ class ExpressionTypeAlias(ChildrenExpressionTypeAliasMixin, ExpressionBase):
347
351
  return False
348
352
 
349
353
 
354
+ class ExpressionTypeVariable(ExpressionTypeVariableBase, ExpressionBase):
355
+ kind = "EXPRESSION_TYPE_VARIABLE"
356
+
357
+ auto_compute_handling = "final,no_raise"
358
+ node_attributes = ("name",)
359
+
360
+
361
+ class ExpressionTypeMakeGeneric(ChildrenExpressionTypeMakeGenericMixin, ExpressionBase):
362
+ kind = "EXPRESSION_TYPE_MAKE_GENERIC"
363
+
364
+ named_children = ("type_params",)
365
+
366
+ def __init__(self, type_params, source_ref):
367
+ ChildrenExpressionTypeMakeGenericMixin.__init__(self, type_params=type_params)
368
+
369
+ ExpressionBase.__init__(self, source_ref)
370
+
371
+ def computeExpression(self, trace_collection):
372
+ trace_collection.onExceptionRaiseExit(BaseException)
373
+
374
+ return self, None, None
375
+
376
+
350
377
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
351
378
  # integrates with CPython, but also works on its own.
352
379
  #
@@ -31,7 +31,8 @@ from .shapes.ControlFlowDescriptions import (
31
31
  ControlFlowDescriptionFullEscape,
32
32
  ControlFlowDescriptionNoEscape,
33
33
  )
34
- from .shapes.StandardShapes import tshape_iterator, tshape_unknown
34
+ from .shapes.IteratorShapes import tshape_iterator
35
+ from .shapes.StandardShapes import tshape_unknown
35
36
  from .StatementBasesGenerated import (
36
37
  StatementAssignmentVariableConstantImmutableBase,
37
38
  StatementAssignmentVariableConstantMutableBase,
@@ -479,6 +479,12 @@ class ShapeTypeBool(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
479
479
  def isKnownToHaveAttribute(attribute_name):
480
480
  return hasattr(True, attribute_name)
481
481
 
482
+ def getOperationUnaryAddShape(self):
483
+ return tshape_int, ControlFlowDescriptionNoEscape
484
+
485
+ def getOperationUnarySubShape(self):
486
+ return tshape_int, ControlFlowDescriptionNoEscape
487
+
482
488
 
483
489
  tshape_bool = ShapeTypeBool()
484
490
 
@@ -492,6 +498,12 @@ class ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
492
498
  def getTypeName():
493
499
  return "int"
494
500
 
501
+ if isExperimental("optimize-dual-int"):
502
+
503
+ @staticmethod
504
+ def getCType():
505
+ return CTypeNuitkaIntOrLongStruct
506
+
495
507
  helper_code = "INT" if python_version < 0x300 else "LONG"
496
508
 
497
509
  add_shapes = add_shapes_int
@@ -536,6 +548,12 @@ class ShapeTypeInt(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
536
548
  def isKnownToHaveAttribute(attribute_name):
537
549
  return hasattr(7, attribute_name)
538
550
 
551
+ def getOperationUnaryAddShape(self):
552
+ return self, ControlFlowDescriptionNoEscape
553
+
554
+ def getOperationUnarySubShape(self):
555
+ return tshape_int_or_long, ControlFlowDescriptionNoEscape
556
+
539
557
 
540
558
  tshape_int = ShapeTypeInt()
541
559
 
@@ -605,7 +623,7 @@ if python_version < 0x300:
605
623
  class ShapeTypeIntOrLong(ShapeNotContainerMixin, ShapeNumberMixin, ShapeBase):
606
624
  __slots__ = ()
607
625
 
608
- if isExperimental("nuitka_ilong"):
626
+ if isExperimental("optimize-dual-int"):
609
627
 
610
628
  @staticmethod
611
629
  def getCType():
@@ -903,11 +921,11 @@ class ShapeTypeList(ShapeContainerMutableMixin, ShapeNotNumberMixin, ShapeBase):
903
921
 
904
922
  # Need to consider value shape for this.
905
923
  if right_shape in (tshape_list, tshape_tuple):
906
- return operation_result_bool_elementbased
924
+ return operation_result_bool_element_based
907
925
 
908
926
  if right_shape is tshape_xrange:
909
927
  if python_version < 0x300:
910
- return operation_result_bool_elementbased
928
+ return operation_result_bool_element_based
911
929
  else:
912
930
  # TODO: Actually unorderable, but this requires making a
913
931
  # difference with "=="
@@ -1693,11 +1711,11 @@ class ShapeTypeXrange(ShapeContainerImmutableMixin, ShapeNotNumberMixin, ShapeBa
1693
1711
  if python_version < 0x300:
1694
1712
  # Need to consider value shape for this.
1695
1713
  if right_shape in (tshape_list, tshape_tuple):
1696
- return operation_result_bool_elementbased
1714
+ return operation_result_bool_element_based
1697
1715
 
1698
1716
  if right_shape is tshape_xrange:
1699
1717
  # TODO: This is value escaping, but that doesn't really apply
1700
- return operation_result_bool_elementbased
1718
+ return operation_result_bool_element_based
1701
1719
  else:
1702
1720
  # TODO: Actually unorderable, but this requires making a
1703
1721
  # difference with "=="
@@ -1908,7 +1926,7 @@ operation_result_dict_noescape = tshape_dict, ControlFlowDescriptionNoEscape
1908
1926
  operation_result_dict_valueerror = tshape_dict, ControlFlowDescriptionValueErrorNoEscape
1909
1927
 
1910
1928
 
1911
- operation_result_bool_elementbased = (
1929
+ operation_result_bool_element_based = (
1912
1930
  tshape_bool,
1913
1931
  ControlFlowDescriptionElementBasedEscape,
1914
1932
  )
@@ -1965,7 +1983,6 @@ operation_result_unsupported_matmult = (
1965
1983
  ControlFlowDescriptionMatmultUnsupported,
1966
1984
  )
1967
1985
 
1968
-
1969
1986
  # ZeroDivisionError can occur for some module and division operations, otherwise they
1970
1987
  # are fixed type.
1971
1988
  operation_result_zerodiv_int = tshape_int, ControlFlowDescriptionZeroDivisionNoEscape
@@ -0,0 +1,71 @@
1
+ # Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+
4
+ """ Iterator shapes that commonly appear. """
5
+
6
+ from .ControlFlowDescriptions import ControlFlowDescriptionFullEscape
7
+ from .ShapeMixins import ShapeIteratorMixin
8
+ from .StandardShapes import ShapeBase, tshape_unknown
9
+
10
+
11
+ class ShapeIterator(ShapeBase, ShapeIteratorMixin):
12
+ """Iterator created by iter with 2 arguments, TODO: could be way more specific."""
13
+
14
+ __slots__ = ()
15
+
16
+ @staticmethod
17
+ def isShapeIterator():
18
+ return None
19
+
20
+ @staticmethod
21
+ def hasShapeSlotBool():
22
+ return None
23
+
24
+ @staticmethod
25
+ def hasShapeSlotLen():
26
+ return None
27
+
28
+ @staticmethod
29
+ def hasShapeSlotInt():
30
+ return None
31
+
32
+ @staticmethod
33
+ def hasShapeSlotLong():
34
+ return None
35
+
36
+ @staticmethod
37
+ def hasShapeSlotFloat():
38
+ return None
39
+
40
+ @staticmethod
41
+ def getShapeIter():
42
+ return tshape_iterator
43
+
44
+ @staticmethod
45
+ def getOperationUnaryReprEscape():
46
+ return ControlFlowDescriptionFullEscape
47
+
48
+ def getOperationUnaryAddShape(self):
49
+ # TODO: Move prepared values to separate module
50
+ return tshape_unknown, ControlFlowDescriptionFullEscape
51
+
52
+ def getOperationUnarySubShape(self):
53
+ return tshape_unknown, ControlFlowDescriptionFullEscape
54
+
55
+
56
+ tshape_iterator = ShapeIterator()
57
+
58
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
59
+ # integrates with CPython, but also works on its own.
60
+ #
61
+ # Licensed under the Apache License, Version 2.0 (the "License");
62
+ # you may not use this file except in compliance with the License.
63
+ # You may obtain a copy of the License at
64
+ #
65
+ # http://www.apache.org/licenses/LICENSE-2.0
66
+ #
67
+ # Unless required by applicable law or agreed to in writing, software
68
+ # distributed under the License is distributed on an "AS IS" BASIS,
69
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70
+ # See the License for the specific language governing permissions and
71
+ # limitations under the License.
@@ -6,9 +6,12 @@
6
6
  """
7
7
 
8
8
  from .ControlFlowDescriptions import (
9
+ ControlFlowDescriptionAddUnsupported,
9
10
  ControlFlowDescriptionElementBasedEscape,
10
11
  ControlFlowDescriptionNoEscape,
12
+ ControlFlowDescriptionSubUnsupported,
11
13
  )
14
+ from .StandardShapes import tshape_unknown
12
15
 
13
16
 
14
17
  class ShapeContainerMixin(object):
@@ -131,10 +134,19 @@ class ShapeNotNumberMixin(object):
131
134
  def hasShapeSlotComplex():
132
135
  return False
133
136
 
137
+ # TODO: Seems misplaced
134
138
  @staticmethod
135
139
  def hasShapeModule():
136
140
  return False
137
141
 
142
+ @staticmethod
143
+ def getOperationUnaryAddShape():
144
+ return tshape_unknown, ControlFlowDescriptionAddUnsupported
145
+
146
+ @staticmethod
147
+ def getOperationUnarySubShape():
148
+ return tshape_unknown, ControlFlowDescriptionSubUnsupported
149
+
138
150
 
139
151
  class ShapeNumberMixin(object):
140
152
  """Mixin that defines the number slots to be set."""
@@ -182,6 +194,12 @@ class ShapeNumberMixin(object):
182
194
  def getOperationUnaryReprEscape():
183
195
  return ControlFlowDescriptionNoEscape
184
196
 
197
+ def getOperationUnaryAddShape(self):
198
+ return self, ControlFlowDescriptionNoEscape
199
+
200
+ def getOperationUnarySubShape(self):
201
+ return self, ControlFlowDescriptionNoEscape
202
+
185
203
 
186
204
  class ShapeIteratorMixin(ShapeNotContainerMixin):
187
205
  # Mixins are required to define empty slots
@@ -8,11 +8,13 @@ from abc import abstractmethod
8
8
  from nuitka.code_generation.c_types.CTypePyObjectPointers import (
9
9
  CTypePyObjectPtr,
10
10
  )
11
- from nuitka.code_generation.Reports import onMissingOperation
11
+ from nuitka.code_generation.Reports import (
12
+ onMissingOperation,
13
+ onMissingUnaryOperation,
14
+ )
12
15
  from nuitka.utils.SlotMetaClasses import getMetaClassBase
13
16
 
14
17
  from .ControlFlowDescriptions import ControlFlowDescriptionFullEscape
15
- from .ShapeMixins import ShapeIteratorMixin
16
18
 
17
19
 
18
20
  class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
@@ -127,7 +129,7 @@ class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
127
129
  return operation_result_unknown
128
130
 
129
131
  # TODO: Change defaults to be "None" for easier catching of
130
- # non-overloaders
132
+ # non-overloading cases.
131
133
  iadd_shapes = {}
132
134
 
133
135
  def getOperationInplaceAddShape(self, right_shape):
@@ -446,6 +448,16 @@ class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
446
448
 
447
449
  return operation_result_unknown
448
450
 
451
+ def getOperationUnaryAddShape(self):
452
+ onMissingUnaryOperation("+", self)
453
+
454
+ return operation_result_unknown
455
+
456
+ def getOperationUnarySubShape(self):
457
+ onMissingUnaryOperation("-", self)
458
+
459
+ return operation_result_unknown
460
+
449
461
  def getComparisonLtShape(self, right_shape):
450
462
  onMissingOperation("Lt", self, right_shape)
451
463
 
@@ -543,6 +555,12 @@ class ShapeTypeUnknown(ShapeBase):
543
555
  def getOperationBinaryMatMultShape(right_shape):
544
556
  return operation_result_unknown
545
557
 
558
+ def getOperationUnaryAddShape(self):
559
+ return operation_result_unknown
560
+
561
+ def getOperationUnarySubShape(self):
562
+ return operation_result_unknown
563
+
546
564
  @staticmethod
547
565
  def getComparisonLtShape(right_shape):
548
566
  return operation_result_unknown
@@ -613,47 +631,6 @@ class ShapeLargeConstantValuePredictable(ShapeLargeConstantValue):
613
631
  self.predictor = predictor
614
632
 
615
633
 
616
- class ShapeIterator(ShapeBase, ShapeIteratorMixin):
617
- """Iterator created by iter with 2 arguments, TODO: could be way more specific."""
618
-
619
- __slots__ = ()
620
-
621
- @staticmethod
622
- def isShapeIterator():
623
- return None
624
-
625
- @staticmethod
626
- def hasShapeSlotBool():
627
- return None
628
-
629
- @staticmethod
630
- def hasShapeSlotLen():
631
- return None
632
-
633
- @staticmethod
634
- def hasShapeSlotInt():
635
- return None
636
-
637
- @staticmethod
638
- def hasShapeSlotLong():
639
- return None
640
-
641
- @staticmethod
642
- def hasShapeSlotFloat():
643
- return None
644
-
645
- @staticmethod
646
- def getShapeIter():
647
- return tshape_iterator
648
-
649
- @staticmethod
650
- def getOperationUnaryReprEscape():
651
- return ControlFlowDescriptionFullEscape
652
-
653
-
654
- tshape_iterator = ShapeIterator()
655
-
656
-
657
634
  class ShapeLoopInitialAlternative(ShapeBase):
658
635
  """Merge of loop wrap around with loop start value.
659
636
 
@@ -898,6 +875,22 @@ class ShapeLoopInitialAlternative(ShapeBase):
898
875
  ControlFlowDescriptionFullEscape,
899
876
  )
900
877
 
878
+ def getOperationUnaryAddShape(self):
879
+ return (
880
+ self._collectInitialShape(
881
+ operation=lambda left_shape: left_shape.getOperationUnaryAddShape()
882
+ ),
883
+ ControlFlowDescriptionFullEscape,
884
+ )
885
+
886
+ def getOperationUnarySubShape(self):
887
+ return (
888
+ self._collectInitialShape(
889
+ operation=lambda left_shape: left_shape.getOperationUnarySubShape()
890
+ ),
891
+ ControlFlowDescriptionFullEscape,
892
+ )
893
+
901
894
  def getComparisonLtShape(self, right_shape):
902
895
  if right_shape is tshape_unknown:
903
896
  return operation_result_unknown
@@ -1162,6 +1155,16 @@ class ShapeLoopCompleteAlternative(ShapeBase):
1162
1155
  )
1163
1156
  )
1164
1157
 
1158
+ def getOperationUnaryAddShape(self):
1159
+ return self._collectShapeOperation(
1160
+ operation=lambda left_shape: left_shape.getOperationUnaryAddShape()
1161
+ )
1162
+
1163
+ def getOperationUnarySubShape(self):
1164
+ return self._collectShapeOperation(
1165
+ operation=lambda left_shape: left_shape.getOperationUnarySubShape()
1166
+ )
1167
+
1165
1168
  # Special method to be called by other shapes encountering this type on
1166
1169
  # the right side.
1167
1170
  def getOperationBinaryAddLShape(self, left_shape):
@@ -23,6 +23,7 @@ from nuitka.plugins.Plugins import (
23
23
  replaceTriggerModule,
24
24
  )
25
25
  from nuitka.Tracing import inclusion_logger
26
+ from nuitka.utils.FileOperations import getNormalizedPath
26
27
 
27
28
 
28
29
  def demoteSourceCodeToBytecode(module_name, source_code, filename):
@@ -59,7 +60,7 @@ def demoteCompiledModuleToBytecode(module):
59
60
  uncompiled_module = makeUncompiledPythonModule(
60
61
  module_name=full_name,
61
62
  reason=module.reason,
62
- filename=filename,
63
+ filename=getNormalizedPath(filename),
63
64
  bytecode=bytecode,
64
65
  is_package=module.isCompiledPythonPackage(),
65
66
  technical=full_name in detectEarlyImports(),