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
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.2.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp311-cp311-win_amd64
5
5
 
nuitka/Builtins.py CHANGED
@@ -212,6 +212,37 @@ builtin_anon_values = OrderedDict((b, a) for a, b in builtin_anon_names.items())
212
212
  # a hash.
213
213
  builtin_anon_value_list = tuple(builtin_anon_values)
214
214
 
215
+ _exception_size_cache = {}
216
+
217
+
218
+ def _getExceptionObjectSize(exception_type):
219
+ if exception_type not in _exception_size_cache:
220
+ # spell-checker: ignore getsizeof
221
+ _exception_size_cache[exception_type] = sys.getsizeof(exception_type())
222
+
223
+ return _exception_size_cache[exception_type]
224
+
225
+
226
+ _base_exception_size = _getExceptionObjectSize(BaseException)
227
+
228
+
229
+ def isBaseExceptionSimpleExtension(exception_type):
230
+ def checkBases(exc_type):
231
+ for base_exception_type in exc_type.__bases__:
232
+ if base_exception_type is BaseException:
233
+ return True
234
+
235
+ if checkBases(base_exception_type):
236
+ return True
237
+
238
+ return False
239
+
240
+ return (
241
+ checkBases(exception_type)
242
+ and _getExceptionObjectSize(exception_type) == _base_exception_size
243
+ )
244
+
245
+
215
246
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
216
247
  # integrates with CPython, but also works on its own.
217
248
  #
@@ -195,6 +195,12 @@ else:
195
195
  module_sys_trust["exc_value"] = trust_not_exist
196
196
  module_sys_trust["exc_traceback"] = trust_not_exist
197
197
 
198
+
199
+ # If we are not a module, we are not in REPL mode.
200
+ if not Options.shallMakeModule():
201
+ module_sys_trust["ps1"] = trust_not_exist
202
+ module_sys_trust["ps2"] = trust_not_exist
203
+
198
204
  module_typing_trust = {
199
205
  "TYPE_CHECKING": trust_constant,
200
206
  }
@@ -223,6 +229,8 @@ def makeTypingModuleTrust():
223
229
  module_os_trust = {
224
230
  "name": trust_constant,
225
231
  "listdir": trust_node,
232
+ "stat": trust_node,
233
+ "lstat": trust_node,
226
234
  "curdir": trust_constant,
227
235
  "pardir": trust_constant,
228
236
  "sep": trust_constant,
nuitka/MainControl.py CHANGED
@@ -41,6 +41,7 @@ from nuitka.Options import (
41
41
  hasPythonFlagIsolated,
42
42
  hasPythonFlagNoAnnotations,
43
43
  hasPythonFlagNoAsserts,
44
+ hasPythonFlagNoBytecodeRuntimeCache,
44
45
  hasPythonFlagNoDocStrings,
45
46
  hasPythonFlagNoWarnings,
46
47
  hasPythonFlagUnbuffered,
@@ -597,6 +598,7 @@ def runSconsBackend():
597
598
  "trace_mode": asBoolStr(Options.shallTraceExecution()),
598
599
  "file_reference_mode": Options.getFileReferenceMode(),
599
600
  "module_count": "%d" % len(ModuleRegistry.getDoneModules()),
601
+ "gil_mode": asBoolStr(Options.isPythonWithGil()),
600
602
  }
601
603
 
602
604
  if Options.isLowMemory():
@@ -699,6 +701,9 @@ def runSconsBackend():
699
701
  if python_version >= 0x370 and sys.flags.utf8_mode:
700
702
  options["python_sysflag_utf8"] = asBoolStr(True)
701
703
 
704
+ if hasPythonFlagNoBytecodeRuntimeCache():
705
+ options["python_sysflag_unbuffered"] = asBoolStr(True)
706
+
702
707
  if hasPythonFlagUnbuffered():
703
708
  options["python_sysflag_unbuffered"] = asBoolStr(True)
704
709
 
@@ -809,7 +814,7 @@ def _executeMain(binary_filename):
809
814
  def _executeModule(tree):
810
815
  """Execute the extension module just created."""
811
816
 
812
- if python_version < 0x340:
817
+ if python_version < 0x300:
813
818
  python_command_template = """\
814
819
  import os, imp;\
815
820
  assert os.path.normcase(os.path.abspath(os.path.normpath(\
@@ -901,8 +906,7 @@ def compileTree():
901
906
  if Options.isShowMemory():
902
907
  InstanceCounters.printStats()
903
908
 
904
- if Options.is_debug:
905
- Reports.doMissingOptimizationReport()
909
+ Reports.doMissingOptimizationReport()
906
910
 
907
911
  if Options.shallNotDoExecCCompilerCall():
908
912
  return True, {}
@@ -1123,7 +1127,8 @@ def _main():
1123
1127
  """\
1124
1128
  The compilation result is hidden by package directory '%s'. Importing will \
1125
1129
  not use compiled code while it exists."""
1126
- % base_path
1130
+ % base_path,
1131
+ mnemonic="compiled-package-hidden-by-package",
1127
1132
  )
1128
1133
 
1129
1134
  general.info("Successfully created '%s'." % final_filename)
nuitka/OptionParsing.py CHANGED
@@ -69,6 +69,21 @@ parser.add_option(
69
69
  Create an importable binary extension module executable instead of a program. Defaults to off.""",
70
70
  )
71
71
 
72
+ parser.add_option(
73
+ "--mode",
74
+ action="store",
75
+ dest="compilation_mode",
76
+ metavar="COMPILATION_MODE",
77
+ choices=("app", "onefile", "standalone", "accelerated", "module"),
78
+ default=None,
79
+ help="""\
80
+ Mode in which to compile. Accelerated runs in your Python
81
+ installation and depends on it. Standalone creates a folder
82
+ with an executable contained to run it. Onefile creates a
83
+ single executable to deploy. App is onefile except on macOS
84
+ where it's not to be used. Default is 'accelerated'.""",
85
+ )
86
+
72
87
  parser.add_option(
73
88
  "--standalone",
74
89
  action="store_true",
@@ -176,11 +191,12 @@ parser.add_option(
176
191
  dest="github_workflow_options",
177
192
  default=False,
178
193
  github_action=False,
179
- help=SUPPRESS_HELP,
194
+ help=SUPPRESS_HELP, # For use in GitHub Action only.
180
195
  )
181
196
 
182
197
  include_group = parser.add_option_group(
183
- "Control the inclusion of modules and packages in result"
198
+ "Control the inclusion of modules and packages in result",
199
+ link="include-section",
184
200
  )
185
201
 
186
202
  include_group.add_option(
@@ -441,8 +457,9 @@ data_group.add_option(
441
457
  help="""\
442
458
  Include the specified data file patterns outside of the onefile binary,
443
459
  rather than on the inside. Makes only sense in case of '--onefile'
444
- compilation. First files have to be specified as included somehow,
445
- then this refers to target paths. Default empty.""",
460
+ compilation. First files have to be specified as included with other
461
+ `--include-*data*` options, and then this refers to target paths
462
+ inside the distribution. Default empty.""",
446
463
  )
447
464
 
448
465
  data_group.add_option(
@@ -625,7 +642,7 @@ compilation_group.add_option(
625
642
  "--file-reference-choice",
626
643
  action="store",
627
644
  dest="file_reference_mode",
628
- metavar="MODE",
645
+ metavar="FILE_MODE",
629
646
  choices=("original", "runtime", "frozen"),
630
647
  default=None,
631
648
  help="""\
@@ -644,7 +661,7 @@ compilation_group.add_option(
644
661
  "--module-name-choice",
645
662
  action="store",
646
663
  dest="module_name_mode",
647
- metavar="MODE",
664
+ metavar="MODULE_NAME_MODE",
648
665
  choices=("original", "runtime"),
649
666
  default=None,
650
667
  help="""\
@@ -710,6 +727,18 @@ used to detect implicit imports.
710
727
  Defaults to off.""",
711
728
  )
712
729
 
730
+ output_group.add_option(
731
+ "--no-pyi-stubs",
732
+ action="store_false",
733
+ dest="pyi_stubs",
734
+ default=True,
735
+ help="""\
736
+ Do not use stubgen when creating a '.pyi' file for extension modules
737
+ created by Nuitka. They expose your API, but stubgen may cause issues.
738
+ Defaults to off.""",
739
+ )
740
+
741
+
713
742
  del output_group
714
743
 
715
744
  deployment_group = parser.add_option_group("Deployment control")
@@ -805,17 +834,6 @@ debug_group.add_option(
805
834
  Enable vmprof based profiling of time spent. Not working currently. Defaults to off.""",
806
835
  )
807
836
 
808
- debug_group.add_option(
809
- "--internal-graph",
810
- action="store_true",
811
- dest="internal_graph",
812
- default=False,
813
- github_action=False,
814
- help="""\
815
- Create graph of optimization process internals, do not use for whole programs, but only
816
- for small test cases. Defaults to off.""",
817
- )
818
-
819
837
  debug_group.add_option(
820
838
  "--trace-execution",
821
839
  action="store_true",
@@ -826,20 +844,6 @@ Traced execution output, output the line of code before executing it.
826
844
  Defaults to off.""",
827
845
  )
828
846
 
829
- debug_group.add_option(
830
- "--recompile-c-only",
831
- action="store_true",
832
- dest="recompile_c_only",
833
- default=False,
834
- github_action=False,
835
- help="""\
836
- This is not incremental compilation, but for Nuitka development only. Takes
837
- existing files and simply compile them as C again. Allows compiling edited
838
- C files for quick debugging changes to the generated source, e.g. to see if
839
- code is passed by, values output, etc, Defaults to off. Depends on compiling
840
- Python source to determine which files it should look at.""",
841
- )
842
-
843
847
  debug_group.add_option(
844
848
  "--xml",
845
849
  action="store",
@@ -906,6 +910,61 @@ off. Do not think you can use this directly.""",
906
910
 
907
911
  del debug_group
908
912
 
913
+
914
+ development_group = parser.add_option_group("Nuitka Development features")
915
+
916
+
917
+ development_group.add_option(
918
+ "--devel-missing-code-helpers",
919
+ action="store_true",
920
+ dest="report_missing_code_helpers",
921
+ default=False,
922
+ help="""\
923
+ Report warnings for code helpers for types that were attempted, but don't
924
+ exist. This helps to identify opportunities for improving optimization of
925
+ generated code from type knowledge not used. Default False.""",
926
+ )
927
+
928
+ development_group.add_option(
929
+ "--devel-missing-trust",
930
+ action="store_true",
931
+ dest="report_missing_trust",
932
+ default=False,
933
+ help="""\
934
+ Report warnings for imports that could be trusted, but currently are not. This
935
+ is to identify opportunities for improving handling of hard modules, where this
936
+ sometimes could allow more static optimization. Default False.""",
937
+ )
938
+
939
+ development_group.add_option(
940
+ "--devel-recompile-c-only",
941
+ action="store_true",
942
+ dest="recompile_c_only",
943
+ default=False,
944
+ github_action=False,
945
+ help="""\
946
+ This is not incremental compilation, but for Nuitka development only. Takes
947
+ existing files and simply compiles them as C again after doing the Python
948
+ steps. Allows compiling edited C files for manual debugging changes to the
949
+ generated source. Allows us to add printing, check and print values, but it
950
+ is now what users would want. Depends on compiling Python source to
951
+ determine which files it should look at.""",
952
+ )
953
+
954
+ development_group.add_option(
955
+ "--devel-internal-graph",
956
+ action="store_true",
957
+ dest="internal_graph",
958
+ default=False,
959
+ github_action=False,
960
+ help="""\
961
+ Create graph of optimization process internals, do not use for whole programs, but only
962
+ for small test cases. Defaults to off.""",
963
+ )
964
+
965
+
966
+ del development_group
967
+
909
968
  # This is for testing framework, "coverage.py" hates to loose the process. And
910
969
  # we can use it to make sure it's not done unknowingly.
911
970
  parser.add_option(
@@ -1058,9 +1117,7 @@ caching_group.add_option(
1058
1117
  action="store_true",
1059
1118
  dest="disable_bytecode_cache",
1060
1119
  default=False,
1061
- help="""\
1062
- Do not reuse dependency analysis results for modules, esp. from standard library,
1063
- that are included as bytecode. Same as --disable-cache=bytecode.""",
1120
+ help=SUPPRESS_HELP,
1064
1121
  )
1065
1122
 
1066
1123
  caching_group.add_option(
@@ -1068,23 +1125,18 @@ caching_group.add_option(
1068
1125
  action="store_true",
1069
1126
  dest="disable_ccache",
1070
1127
  default=False,
1071
- help="""\
1072
- Do not attempt to use ccache (gcc, clang, etc.) or clcache (MSVC, clangcl).
1073
- Same as --disable-cache=ccache.""",
1128
+ help=SUPPRESS_HELP,
1074
1129
  )
1075
1130
 
1076
- if isWin32Windows():
1077
- caching_group.add_option(
1078
- "--disable-dll-dependency-cache",
1079
- action="store_true",
1080
- dest="disable_dll_dependency_cache",
1081
- default=False,
1082
- help="""\
1083
- Disable the dependency walker cache. Will result in much longer times to create
1084
- the distribution folder, but might be used in case the cache is suspect to cause
1085
- errors. Same as --disable-cache=dll-dependencies.""",
1086
- )
1131
+ caching_group.add_option(
1132
+ "--disable-dll-dependency-cache",
1133
+ action="store_true",
1134
+ dest="disable_dll_dependency_cache",
1135
+ default=False,
1136
+ help=SUPPRESS_HELP,
1137
+ )
1087
1138
 
1139
+ if isWin32Windows():
1088
1140
  caching_group.add_option(
1089
1141
  "--force-dll-dependency-cache-update",
1090
1142
  action="store_true",
@@ -1119,7 +1171,7 @@ pgo_group.add_option(
1119
1171
  action="store_true",
1120
1172
  dest="is_python_pgo",
1121
1173
  default=False,
1122
- help=SUPPRESS_HELP,
1174
+ help=SUPPRESS_HELP, # Not yet ready
1123
1175
  )
1124
1176
 
1125
1177
  pgo_group.add_option(
@@ -1127,7 +1179,7 @@ pgo_group.add_option(
1127
1179
  action="store",
1128
1180
  dest="python_pgo_input",
1129
1181
  default=None,
1130
- help=SUPPRESS_HELP,
1182
+ help=SUPPRESS_HELP, # Not yet ready
1131
1183
  )
1132
1184
 
1133
1185
  pgo_group.add_option(
@@ -1136,7 +1188,7 @@ pgo_group.add_option(
1136
1188
  dest="python_pgo_policy_unused_module",
1137
1189
  choices=("include", "exclude", "bytecode"),
1138
1190
  default="include",
1139
- help=SUPPRESS_HELP,
1191
+ help=SUPPRESS_HELP, # Not yet ready
1140
1192
  )
1141
1193
 
1142
1194
  pgo_group.add_option(
@@ -1351,14 +1403,16 @@ windows_group.add_option(
1351
1403
  "--windows-console-mode",
1352
1404
  action="store",
1353
1405
  dest="console_mode",
1354
- choices=("force", "disable", "attach"),
1406
+ choices=("force", "disable", "attach", "hide"),
1355
1407
  metavar="CONSOLE_MODE",
1356
1408
  default=None,
1357
1409
  help="""\
1358
1410
  Select console mode to use. Default mode is 'force' and creates a
1359
1411
  console window unless the program was started from one. With 'disable'
1360
1412
  it doesn't create or use a console at all. With 'attach' an existing
1361
- console will be used for outputs. Default is 'force'.
1413
+ console will be used for outputs. With 'hide' a newly spawned console
1414
+ will be hidden and an already existing console will behave like
1415
+ 'force'. Default is 'force'.
1362
1416
  """,
1363
1417
  )
1364
1418
 
@@ -1569,7 +1623,7 @@ macos_group.add_option(
1569
1623
  "--macos-app-mode",
1570
1624
  action="store",
1571
1625
  dest="macos_app_mode",
1572
- metavar="MODE",
1626
+ metavar="APP_MODE",
1573
1627
  choices=("gui", "background", "ui-element"),
1574
1628
  default="gui",
1575
1629
  help="""\
nuitka/Options.py CHANGED
@@ -20,7 +20,10 @@ import sys
20
20
 
21
21
  from nuitka import Progress, Tracing
22
22
  from nuitka.containers.OrderedDicts import OrderedDict
23
- from nuitka.containers.OrderedSets import OrderedSet
23
+ from nuitka.containers.OrderedSets import (
24
+ OrderedSet,
25
+ recommended_orderedset_package_name,
26
+ )
24
27
  from nuitka.importing.StandardLibrary import isStandardLibraryPath
25
28
  from nuitka.OptionParsing import (
26
29
  parseOptions,
@@ -54,12 +57,14 @@ from nuitka.PythonVersions import (
54
57
  from nuitka.utils.Execution import getExecutablePath
55
58
  from nuitka.utils.FileOperations import (
56
59
  getNormalizedPath,
60
+ getReportPath,
57
61
  isLegalPath,
58
62
  isPathExecutable,
59
63
  openTextFile,
60
64
  resolveShellPatternToFilenames,
61
65
  )
62
66
  from nuitka.utils.Images import checkIconUsage
67
+ from nuitka.utils.Importing import getInlineCopyFolder
63
68
  from nuitka.utils.StaticLibraries import getSystemStaticLibPythonPath
64
69
  from nuitka.utils.Utils import (
65
70
  getArchitecture,
@@ -89,7 +94,8 @@ is_nuitka_run = None
89
94
  is_debug = None
90
95
  is_non_debug = None
91
96
  is_full_compat = None
92
- is_report_missing = None
97
+ report_missing_code_helpers = None
98
+ report_missing_trust = None
93
99
  is_verbose = None
94
100
 
95
101
 
@@ -291,15 +297,13 @@ it with e.g. '{TEMP}', '{CACHE_DIR}' is recommended: '%s'"""
291
297
 
292
298
 
293
299
  def _getVersionInformationValues():
294
- # TODO: Might be nice if we could delay version information computation
295
- # until it's actually used.
296
300
  yield getNuitkaVersion()
297
301
  yield "Commercial: %s" % getCommercialVersion()
298
302
  yield "Python: %s" % sys.version.split("\n", 1)[0]
299
303
  yield "Flavor: %s" % getPythonFlavorName()
300
304
  if python_version >= 0x3D0:
301
305
  yield "GIL: %s" % ("yes" if isPythonWithGil() else "no")
302
- yield "Executable: %s" % sys.executable
306
+ yield "Executable: %s" % getReportPath(sys.executable)
303
307
  yield "OS: %s" % getOS()
304
308
  yield "Arch: %s" % getArchitecture()
305
309
 
@@ -381,7 +385,7 @@ def parseArgs():
381
385
  # singleton with many cases checking the options right away.
382
386
  # pylint: disable=global-statement,too-many-branches,too-many-locals,too-many-statements
383
387
  global is_nuitka_run, options, positional_args, extra_args, is_debug, is_non_debug
384
- global is_full_compat, is_report_missing, is_verbose
388
+ global is_full_compat, report_missing_code_helpers, report_missing_trust, is_verbose
385
389
 
386
390
  if os.name == "nt":
387
391
  # Windows store Python's don't allow looking at the python, catch that.
@@ -414,8 +418,8 @@ Error, the Python from Windows app store is not supported.""",
414
418
  if getattr(options, "disable_dll_dependency_cache", False):
415
419
  options.disabled_caches.append("dll-dependencies")
416
420
 
417
- # TODO: Have dedicated option for it.
418
- is_report_missing = is_debug
421
+ report_missing_code_helpers = options.report_missing_code_helpers
422
+ report_missing_trust = options.report_missing_trust
419
423
 
420
424
  if options.quiet or int(os.getenv("NUITKA_QUIET", "0")):
421
425
  Tracing.setQuiet()
@@ -488,6 +492,29 @@ Error, the Python from Windows app store is not supported.""",
488
492
 
489
493
  Tracing.progress_logger.is_quiet = not options.show_progress
490
494
 
495
+ if options.compilation_mode is not None:
496
+ if (
497
+ options.is_onefile
498
+ or options.is_standalone
499
+ or options.module_mode
500
+ or options.macos_create_bundle
501
+ ):
502
+ Tracing.options_logger.sysexit(
503
+ "Cannot use both '--mode=' and deprecated options that specify mode."
504
+ )
505
+
506
+ if options.compilation_mode == "onefile":
507
+ options.is_onefile = True
508
+ elif options.compilation_mode == "standalone":
509
+ options.is_standalone = True
510
+ elif options.compilation_mode == "module":
511
+ options.module_mode = True
512
+ elif options.compilation_mode == "app":
513
+ if isMacOS():
514
+ options.macos_create_bundle = True
515
+ else:
516
+ options.is_onefile = True
517
+
491
518
  # Onefile implies standalone build.
492
519
  if options.is_onefile:
493
520
  options.is_standalone = True
@@ -1171,7 +1198,7 @@ but errors may happen."""
1171
1198
  """\
1172
1199
  Using very slow fallback for ordered sets, please install '%s' \
1173
1200
  PyPI package for best Python compile time performance."""
1174
- % ("ordered-set" if python_version >= 0x370 else "orderedset")
1201
+ % recommended_orderedset_package_name
1175
1202
  )
1176
1203
 
1177
1204
  if shallUsePythonDebug() and not isDebugPython():
@@ -1319,7 +1346,7 @@ def getModuleNameMode():
1319
1346
 
1320
1347
  def shallMakeModule():
1321
1348
  """:returns: bool derived from ``--module``"""
1322
- return options.module_mode
1349
+ return options is not None and options.module_mode
1323
1350
 
1324
1351
 
1325
1352
  def shallCreatePyiFile():
@@ -1327,6 +1354,11 @@ def shallCreatePyiFile():
1327
1354
  return options.pyi_file
1328
1355
 
1329
1356
 
1357
+ def shallCreatePyiFileContainStubs():
1358
+ """*bool* = **not** ``--no-pyi-stubs``"""
1359
+ return options.pyi_stubs
1360
+
1361
+
1330
1362
  def isAllowedToReexecute():
1331
1363
  """*bool* = **not** ``--must-not-re-execute``"""
1332
1364
  return options.allow_reexecute
@@ -1445,6 +1477,14 @@ def getShallIncludeDataDirs():
1445
1477
  yield src, dest
1446
1478
 
1447
1479
 
1480
+ def getShallIncludeRawDirs():
1481
+ """*list*, items of ``--include-raw-dir=``"""
1482
+ for data_file in options.raw_dirs:
1483
+ src, dest = data_file.split("=", 1)
1484
+
1485
+ yield src, dest
1486
+
1487
+
1448
1488
  def getShallNotIncludeDataFilePatterns():
1449
1489
  """*list*, items of ``--noinclude-data-files=``"""
1450
1490
 
@@ -1526,7 +1566,7 @@ def getOutputFilename():
1526
1566
  def getOutputPath(path):
1527
1567
  """Return output pathname of a given path (filename)."""
1528
1568
  if options.output_dir:
1529
- return os.path.normpath(os.path.join(options.output_dir, path))
1569
+ return getNormalizedPath(os.path.join(options.output_dir, path))
1530
1570
  else:
1531
1571
  return path
1532
1572
 
@@ -1556,7 +1596,7 @@ def getMainEntryPointFilenames():
1556
1596
  else:
1557
1597
  result = (positional_args[0],)
1558
1598
 
1559
- return tuple(os.path.normpath(r).rstrip(os.path.sep) for r in result)
1599
+ return tuple(getNormalizedPath(r) for r in result)
1560
1600
 
1561
1601
 
1562
1602
  def isMultidistMode():
@@ -1596,6 +1636,14 @@ def _shallUseStaticLibPython():
1596
1636
  and isDebianSuitableForStaticLinking()
1597
1637
  and not shallUsePythonDebug()
1598
1638
  ):
1639
+ if python_version >= 0x3C0 and not os.path.exists(
1640
+ getInlineCopyFolder("python_hacl")
1641
+ ):
1642
+ return (
1643
+ False,
1644
+ "Nuitka on Debian-Python needs inline copy of hacl not included.",
1645
+ )
1646
+
1599
1647
  return True, "Nuitka on Debian-Python needs package '%s' installed." % (
1600
1648
  "python2-dev" if str is bytes else "python3-dev"
1601
1649
  )
@@ -2299,6 +2347,8 @@ def _getPythonFlags():
2299
2347
  _python_flags.add("package_mode")
2300
2348
  elif part in ("-I", "isolated"):
2301
2349
  _python_flags.add("isolated")
2350
+ elif part in ("-B", "dontwritebytecode"):
2351
+ _python_flags.add("dontwritebytecode")
2302
2352
  else:
2303
2353
  Tracing.options_logger.sysexit(
2304
2354
  "Unsupported python flag '%s'." % part
@@ -2355,8 +2405,14 @@ def hasPythonFlagNoRandomization():
2355
2405
  return "no_randomization" in _getPythonFlags()
2356
2406
 
2357
2407
 
2408
+ def hasPythonFlagNoBytecodeRuntimeCache():
2409
+ """*bool* = "dontwritebytecode", "-u" in python flags given"""
2410
+
2411
+ return "dontwritebytecode" in _getPythonFlags()
2412
+
2413
+
2358
2414
  def hasPythonFlagUnbuffered():
2359
- """*bool* = "package_mode", "-m" in python flags given"""
2415
+ """*bool* = "unbuffered", "-u" in python flags given"""
2360
2416
 
2361
2417
  return "unbuffered" in _getPythonFlags()
2362
2418
 
@@ -15,6 +15,7 @@ import os
15
15
  from nuitka import Options
16
16
  from nuitka.utils.FileOperations import (
17
17
  addFilenameExtension,
18
+ getNormalizedPath,
18
19
  makePath,
19
20
  putTextFileContents,
20
21
  )
@@ -39,10 +40,14 @@ def hasMainModule():
39
40
  return _main_module is not None
40
41
 
41
42
 
43
+ def getMainModule():
44
+ return _main_module
45
+
46
+
42
47
  def getSourceDirectoryPath(onefile=False):
43
48
  """Return path inside the build directory."""
44
49
 
45
- # Distinct build folders for oneline mode.
50
+ # Distinct build folders for onefile mode.
46
51
  if onefile:
47
52
  suffix = ".onefile-build"
48
53
  else:
@@ -139,7 +144,7 @@ def getResultFullpath(onefile):
139
144
  if not isWin32OrPosixWindows() and Options.isOnefileMode() and not onefile:
140
145
  result = addFilenameExtension(result, ".bin")
141
146
 
142
- return result
147
+ return getNormalizedPath(result)
143
148
 
144
149
 
145
150
  def getResultRunFilename(onefile):