Nuitka-winsvc 2.4.8__cp311-cp311-win_amd64.whl → 2.5.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 (294) hide show
  1. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/METADATA +2 -1
  2. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/RECORD +294 -271
  3. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.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 +105 -52
  8. nuitka/Options.py +73 -16
  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 +12 -2
  20. nuitka/build/SconsCompilerSettings.py +17 -6
  21. nuitka/build/SconsInterface.py +1 -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 +6 -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 +65 -29
  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/helpers.h +12 -2
  50. nuitka/build/include/nuitka/prelude.h +35 -25
  51. nuitka/build/include/nuitka/printing.h +9 -7
  52. nuitka/build/include/nuitka/threading.h +15 -1
  53. nuitka/build/include/nuitka/type_aliases.h +3 -0
  54. nuitka/build/inline_copy/stubgen/astunparse.py +938 -0
  55. nuitka/build/inline_copy/stubgen/six.py +998 -0
  56. nuitka/build/inline_copy/stubgen/stubgen.py +307 -0
  57. nuitka/build/static_src/CompiledAsyncgenType.c +45 -39
  58. nuitka/build/static_src/CompiledCellType.c +6 -4
  59. nuitka/build/static_src/CompiledCodeHelpers.c +104 -40
  60. nuitka/build/static_src/CompiledCoroutineType.c +40 -30
  61. nuitka/build/static_src/CompiledFrameType.c +110 -79
  62. nuitka/build/static_src/CompiledFunctionType.c +173 -151
  63. nuitka/build/static_src/CompiledGeneratorType.c +51 -49
  64. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +424 -46
  65. nuitka/build/static_src/CompiledMethodType.c +10 -13
  66. nuitka/build/static_src/HelpersAllocator.c +270 -32
  67. nuitka/build/static_src/HelpersAttributes.c +0 -21
  68. nuitka/build/static_src/HelpersBuiltin.c +22 -13
  69. nuitka/build/static_src/HelpersCalling.c +7 -7
  70. nuitka/build/static_src/HelpersCallingGenerated.c +70 -70
  71. nuitka/build/static_src/HelpersComparisonDualEq.c +183 -0
  72. nuitka/build/static_src/HelpersComparisonDualGe.c +121 -0
  73. nuitka/build/static_src/HelpersComparisonDualGt.c +121 -0
  74. nuitka/build/static_src/HelpersComparisonDualLe.c +183 -0
  75. nuitka/build/static_src/HelpersComparisonDualLt.c +183 -0
  76. nuitka/build/static_src/HelpersComparisonDualNe.c +121 -0
  77. nuitka/build/static_src/HelpersComparisonEq.c +18 -4
  78. nuitka/build/static_src/HelpersComparisonEqUtils.c +1 -0
  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 +10 -4
  86. nuitka/build/static_src/HelpersDictionaries.c +181 -34
  87. nuitka/build/static_src/HelpersDictionariesGenerated.c +0 -106
  88. nuitka/build/static_src/HelpersExceptions.c +24 -50
  89. nuitka/build/static_src/HelpersFiles.c +79 -5
  90. nuitka/build/static_src/HelpersImport.c +13 -9
  91. nuitka/build/static_src/HelpersImportHard.c +23 -46
  92. nuitka/build/static_src/HelpersLists.c +98 -9
  93. nuitka/build/static_src/HelpersMatching.c +1 -1
  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 +1 -1
  129. nuitka/build/static_src/HelpersTypes.c +98 -2
  130. nuitka/build/static_src/MainProgram.c +117 -29
  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 +73 -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 +0 -105
  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 +13 -3
  209. nuitka/freezer/DllDependenciesMacOS.py +18 -1
  210. nuitka/freezer/DllDependenciesWin32.py +26 -12
  211. nuitka/freezer/ImportDetection.py +3 -0
  212. nuitka/freezer/IncludedDataFiles.py +31 -8
  213. nuitka/freezer/IncludedEntryPoints.py +3 -2
  214. nuitka/freezer/Standalone.py +76 -18
  215. nuitka/importing/Importing.py +33 -6
  216. nuitka/importing/Recursion.py +12 -1
  217. nuitka/importing/StandardLibrary.py +57 -59
  218. nuitka/nodes/AsyncgenNodes.py +3 -6
  219. nuitka/nodes/BuiltinIteratorNodes.py +1 -1
  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/ExceptionNodes.py +102 -26
  225. nuitka/nodes/ExpressionBasesGenerated.py +288 -4
  226. nuitka/nodes/FrameNodes.py +22 -11
  227. nuitka/nodes/FunctionNodes.py +3 -3
  228. nuitka/nodes/GeneratorNodes.py +3 -6
  229. nuitka/nodes/HardImportNodesGenerated.py +182 -0
  230. nuitka/nodes/ImportNodes.py +2 -2
  231. nuitka/nodes/NodeBases.py +28 -1
  232. nuitka/nodes/NodeMakingHelpers.py +71 -50
  233. nuitka/nodes/OperatorNodesUnary.py +128 -3
  234. nuitka/nodes/OsSysNodes.py +37 -6
  235. nuitka/nodes/OutlineNodes.py +2 -2
  236. nuitka/nodes/StatementBasesGenerated.py +0 -2
  237. nuitka/nodes/StatementNodes.py +8 -7
  238. nuitka/nodes/SubscriptNodes.py +1 -1
  239. nuitka/nodes/TypeNodes.py +28 -1
  240. nuitka/nodes/shapes/BuiltinTypeShapes.py +24 -7
  241. nuitka/nodes/shapes/ShapeMixins.py +17 -0
  242. nuitka/nodes/shapes/StandardShapes.py +53 -1
  243. nuitka/optimizations/BytecodeDemotion.py +2 -1
  244. nuitka/plugins/PluginBase.py +64 -22
  245. nuitka/plugins/Plugins.py +6 -3
  246. nuitka/plugins/standard/AntiBloatPlugin.py +23 -12
  247. nuitka/plugins/standard/ImplicitImports.py +1 -13
  248. nuitka/plugins/standard/KivyPlugin.py +3 -12
  249. nuitka/plugins/standard/MatplotlibPlugin.py +12 -1
  250. nuitka/plugins/standard/MultiprocessingPlugin.py +11 -20
  251. nuitka/plugins/standard/PlaywrightPlugin.py +184 -0
  252. nuitka/plugins/standard/PySidePyQtPlugin.py +8 -0
  253. nuitka/plugins/standard/TkinterPlugin.py +0 -56
  254. nuitka/plugins/standard/TransformersPlugin.py +70 -275
  255. nuitka/plugins/standard/standard.nuitka-package.config.yml +510 -28
  256. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +35 -2
  257. nuitka/reports/CompilationReportReader.py +12 -0
  258. nuitka/reports/Reports.py +11 -0
  259. nuitka/specs/BuiltinParameterSpecs.py +5 -1
  260. nuitka/specs/HardImportSpecs.py +7 -0
  261. nuitka/specs/ParameterSpecs.py +4 -4
  262. nuitka/tools/general/dll_report/__main__.py +10 -1
  263. nuitka/tools/onefile_compressor/OnefileCompressor.py +1 -1
  264. nuitka/tools/specialize/CTypeDescriptions.py +158 -9
  265. nuitka/tools/specialize/SpecializeC.py +218 -56
  266. nuitka/tools/testing/Common.py +70 -63
  267. nuitka/tools/testing/compare_with_cpython/__main__.py +3 -1
  268. nuitka/tools/testing/measure_construct_performance/__main__.py +1 -8
  269. nuitka/tools/testing/run_nuitka_tests/__main__.py +77 -11
  270. nuitka/tools/watch/AutoStage.py +1 -0
  271. nuitka/tree/Building.py +10 -37
  272. nuitka/tree/ComplexCallHelperFunctions.py +4 -0
  273. nuitka/tree/ReformulationAssertStatements.py +31 -14
  274. nuitka/tree/ReformulationAssignmentStatements.py +5 -1
  275. nuitka/tree/ReformulationClasses3.py +94 -19
  276. nuitka/tree/ReformulationDictionaryCreation.py +1 -0
  277. nuitka/tree/ReformulationFunctionStatements.py +1 -1
  278. nuitka/tree/ReformulationMatchStatements.py +3 -1
  279. nuitka/tree/ReformulationYieldExpressions.py +23 -5
  280. nuitka/utils/CommandLineOptions.py +27 -3
  281. nuitka/utils/Download.py +2 -2
  282. nuitka/utils/Execution.py +36 -31
  283. nuitka/utils/FileOperations.py +39 -54
  284. nuitka/utils/Importing.py +2 -14
  285. nuitka/utils/InlineCopies.py +52 -0
  286. nuitka/utils/InstalledPythons.py +9 -4
  287. nuitka/utils/Json.py +2 -2
  288. nuitka/utils/PackageResources.py +44 -0
  289. nuitka/utils/Utils.py +17 -0
  290. {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka-run.cmd +0 -0
  291. {Nuitka_winsvc-2.4.8.data → Nuitka_winsvc-2.5.1.data}/scripts/nuitka.cmd +0 -0
  292. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/LICENSE.txt +0 -0
  293. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/entry_points.txt +0 -0
  294. {Nuitka_winsvc-2.4.8.dist-info → Nuitka_winsvc-2.5.1.dist-info}/top_level.txt +0 -0
@@ -16,12 +16,11 @@ And releasing of values, as this is what the error case commonly does.
16
16
 
17
17
  from nuitka.PythonVersions import python_version
18
18
 
19
- from .ExceptionCodes import getExceptionIdentifier
20
19
  from .Indentation import indented
21
20
  from .LineNumberCodes import getErrorLineNumberUpdateCode
22
21
  from .templates.CodeTemplatesExceptions import (
23
22
  template_error_catch_exception,
24
- template_error_catch_quick_exception,
23
+ template_error_catch_fetched_exception,
25
24
  template_error_format_name_error_exception,
26
25
  template_error_format_string_exception,
27
26
  )
@@ -32,12 +31,15 @@ def getErrorExitReleaseCode(context):
32
31
  "Py_DECREF(%s);" % tmp_name for tmp_name in context.getCleanupTempNames()
33
32
  )
34
33
 
35
- keeper_variables = context.getExceptionKeeperVariables()
34
+ (
35
+ keeper_exception_state_name,
36
+ _keeper_lineno,
37
+ ) = context.getExceptionKeeperVariables()
36
38
 
37
- if keeper_variables[0] is not None:
38
- temp_release += "\nPy_DECREF(%s);" % keeper_variables[0]
39
- temp_release += "\nPy_XDECREF(%s);" % keeper_variables[1]
40
- temp_release += "\nPy_XDECREF(%s);" % keeper_variables[2]
39
+ if keeper_exception_state_name is not None:
40
+ temp_release += (
41
+ "\nRELEASE_ERROR_OCCURRED_STATE(&%s);" % keeper_exception_state_name
42
+ )
41
43
 
42
44
  return temp_release
43
45
 
@@ -60,8 +62,8 @@ def getErrorExitBoolCode(
60
62
  context,
61
63
  release_names=(),
62
64
  release_name=None,
65
+ fetched_exception=False,
63
66
  needs_check=True,
64
- quick_exception=None,
65
67
  ):
66
68
  assert not condition.endswith(";")
67
69
 
@@ -79,23 +81,18 @@ def getErrorExitBoolCode(
79
81
  return
80
82
 
81
83
  (
82
- exception_type,
83
- exception_value,
84
- exception_tb,
84
+ exception_state_name,
85
85
  _exception_lineno,
86
86
  ) = context.variable_storage.getExceptionVariableDescriptions()
87
87
 
88
- if quick_exception:
88
+ if fetched_exception:
89
89
  emit(
90
90
  indented(
91
- template_error_catch_quick_exception
91
+ template_error_catch_fetched_exception
92
92
  % {
93
93
  "condition": condition,
94
- "exception_type": exception_type,
95
- "exception_value": exception_value,
96
- "exception_tb": exception_tb,
94
+ "exception_state_name": exception_state_name,
97
95
  "exception_exit": context.getExceptionEscape(),
98
- "quick_exception": getExceptionIdentifier(quick_exception),
99
96
  "release_temps": indented(getErrorExitReleaseCode(context)),
100
97
  "var_description_code": indented(
101
98
  getFrameVariableTypeDescriptionCode(context)
@@ -111,9 +108,7 @@ def getErrorExitBoolCode(
111
108
  template_error_catch_exception
112
109
  % {
113
110
  "condition": condition,
114
- "exception_type": exception_type,
115
- "exception_value": exception_value,
116
- "exception_tb": exception_tb,
111
+ "exception_state_name": exception_state_name,
117
112
  "exception_exit": context.getExceptionEscape(),
118
113
  "release_temps": indented(getErrorExitReleaseCode(context)),
119
114
  "var_description_code": indented(
@@ -132,7 +127,7 @@ def getErrorExitCode(
132
127
  context,
133
128
  release_names=(),
134
129
  release_name=None,
135
- quick_exception=None,
130
+ fetched_exception=False,
136
131
  needs_check=True,
137
132
  ):
138
133
  getErrorExitBoolCode(
@@ -140,7 +135,7 @@ def getErrorExitCode(
140
135
  release_names=release_names,
141
136
  release_name=release_name,
142
137
  needs_check=needs_check,
143
- quick_exception=quick_exception,
138
+ fetched_exception=fetched_exception,
144
139
  emit=emit,
145
140
  context=context,
146
141
  )
@@ -148,25 +143,22 @@ def getErrorExitCode(
148
143
 
149
144
  def _getExceptionChainingCode(context):
150
145
  (
151
- exception_type,
152
- exception_value,
153
- exception_tb,
146
+ exception_state_name,
154
147
  _exception_lineno,
155
148
  ) = context.variable_storage.getExceptionVariableDescriptions()
156
149
 
157
- keeper_vars = context.getExceptionKeeperVariables()
150
+ (
151
+ keeper_exception_state_name,
152
+ _keeper_lineno,
153
+ ) = context.getExceptionKeeperVariables()
158
154
 
159
- if keeper_vars[0] is not None:
160
- return (
161
- "ADD_EXCEPTION_CONTEXT(tstate, &%s, &%s);"
162
- % (keeper_vars[0], keeper_vars[1]),
163
- )
155
+ if keeper_exception_state_name is not None:
156
+ yield "ADD_EXCEPTION_CONTEXT(tstate, &%s);" % keeper_exception_state_name
164
157
  else:
165
- return (
166
- "NORMALIZE_EXCEPTION(tstate, &%s, &%s, &%s);"
167
- % (exception_type, exception_value, exception_tb),
168
- "CHAIN_EXCEPTION(tstate, %s);" % exception_value,
169
- )
158
+ if python_version < 0x3C0:
159
+ yield "NORMALIZE_EXCEPTION_STATE(tstate, &%s);" % exception_state_name
160
+
161
+ yield "CHAIN_EXCEPTION(tstate, %s.exception_value);" % exception_state_name
170
162
 
171
163
 
172
164
  def getTakeReferenceCode(value_name, emit):
@@ -204,9 +196,7 @@ def getLocalVariableReferenceErrorCode(variable, condition, emit, context):
204
196
  variable_name = variable.getName()
205
197
 
206
198
  (
207
- exception_type,
208
- exception_value,
209
- exception_tb,
199
+ exception_state_name,
210
200
  _exception_lineno,
211
201
  ) = context.variable_storage.getExceptionVariableDescriptions()
212
202
 
@@ -216,14 +206,12 @@ def getLocalVariableReferenceErrorCode(variable, condition, emit, context):
216
206
  helper_code = "FORMAT_UNBOUND_LOCAL_ERROR"
217
207
 
218
208
  set_exception = [
219
- "%s(&%s, &%s, %s);"
209
+ "%s(tstate, &%s, %s);"
220
210
  % (
221
211
  helper_code,
222
- exception_type,
223
- exception_value,
212
+ exception_state_name,
224
213
  context.getConstantCode(variable_name),
225
214
  ),
226
- "%s = NULL;" % exception_tb,
227
215
  ]
228
216
 
229
217
  # TODO: Move this into the helper code.
@@ -249,16 +237,14 @@ def getLocalVariableReferenceErrorCode(variable, condition, emit, context):
249
237
  def getNameReferenceErrorCode(variable_name, condition, emit, context):
250
238
  helper_code = "RAISE_CURRENT_EXCEPTION_NAME_ERROR"
251
239
 
252
- if python_version < 0x340:
240
+ if python_version < 0x300:
253
241
  owner = context.getOwner()
254
242
 
255
243
  if not owner.isCompiledPythonModule() and not owner.isExpressionClassBodyBase():
256
244
  helper_code = "RAISE_CURRENT_EXCEPTION_GLOBAL_NAME_ERROR"
257
245
 
258
246
  (
259
- exception_type,
260
- exception_value,
261
- exception_tb,
247
+ exception_state_name,
262
248
  _exception_lineno,
263
249
  ) = context.variable_storage.getExceptionVariableDescriptions()
264
250
 
@@ -274,9 +260,7 @@ def getNameReferenceErrorCode(variable_name, condition, emit, context):
274
260
  getFrameVariableTypeDescriptionCode(context)
275
261
  ),
276
262
  "line_number_code": indented(getErrorLineNumberUpdateCode(context)),
277
- "exception_type": exception_type,
278
- "exception_value": exception_value,
279
- "exception_tb": exception_tb,
263
+ "exception_state_name": exception_state_name,
280
264
  }
281
265
  )
282
266
 
@@ -11,6 +11,7 @@ from .CodeHelpers import (
11
11
  generateExpressionCode,
12
12
  withObjectCodeTemporaryAssignment,
13
13
  )
14
+ from .ErrorCodes import getErrorExitCode
14
15
  from .templates.CodeTemplatesExceptions import (
15
16
  template_publish_exception_to_handler,
16
17
  )
@@ -42,57 +43,83 @@ def getTracebackMakingIdentifier(context, lineno_name):
42
43
 
43
44
 
44
45
  def generateExceptionCaughtTypeCode(to_name, expression, emit, context):
45
- keeper_variables = context.getExceptionKeeperVariables()
46
+ (
47
+ keeper_exception_state_name,
48
+ _keeper_lineno,
49
+ ) = context.getExceptionKeeperVariables()
46
50
 
47
51
  with withObjectCodeTemporaryAssignment(
48
52
  to_name, "exception_caught_type", expression, emit, context
49
53
  ) as value_name:
50
- if keeper_variables[0] is None:
51
- emit("%s = EXC_TYPE(PyThreadState_GET());" % (value_name,))
54
+ if keeper_exception_state_name is None:
55
+ emit("%s = EXC_TYPE(tstate);" % (value_name,))
52
56
  else:
53
- emit("%s = %s;" % (value_name, keeper_variables[0]))
57
+ if python_version < 0x3C0:
58
+ emit(
59
+ "%s = %s.exception_type;"
60
+ % (value_name, keeper_exception_state_name)
61
+ )
62
+ else:
63
+ emit(
64
+ "%s = %s.exception_value;"
65
+ % (value_name, keeper_exception_state_name)
66
+ )
54
67
 
55
68
 
56
69
  def generateExceptionCaughtValueCode(to_name, expression, emit, context):
57
- keeper_variables = context.getExceptionKeeperVariables()
70
+ (
71
+ keeper_exception_state_name,
72
+ _keeper_lineno,
73
+ ) = context.getExceptionKeeperVariables()
58
74
 
59
75
  with withObjectCodeTemporaryAssignment(
60
76
  to_name, "exception_caught_value", expression, emit, context
61
77
  ) as value_name:
62
- if keeper_variables[1] is None:
63
- emit("%s = EXC_VALUE(PyThreadState_GET());" % (value_name,))
78
+ if keeper_exception_state_name is None:
79
+ emit("%s = EXC_VALUE(tstate);" % value_name)
80
+ elif python_version >= 0x270:
81
+ emit("%s = %s.exception_value;" % (value_name, keeper_exception_state_name))
64
82
  else:
65
- if python_version >= 0x270:
66
- emit("%s = %s;" % (value_name, keeper_variables[1]))
67
- else:
68
- emit(
69
- "%s = %s ? %s : Py_None;"
70
- % (value_name, keeper_variables[1], keeper_variables[1])
83
+ # For Python2.6, value can be NULL.
84
+ emit(
85
+ "%s = %s.exception_value ? %s.exception_value : Py_None;"
86
+ % (
87
+ value_name,
88
+ keeper_exception_state_name,
89
+ keeper_exception_state_name,
71
90
  )
91
+ )
92
+
93
+ emit("CHECK_OBJECT(%s); " % value_name)
72
94
 
73
95
 
74
96
  def generateExceptionCaughtTracebackCode(to_name, expression, emit, context):
75
- keeper_variables = context.getExceptionKeeperVariables()
97
+ (
98
+ keeper_exception_state_name,
99
+ keeper_lineno,
100
+ ) = context.getExceptionKeeperVariables()
76
101
 
77
102
  with withObjectCodeTemporaryAssignment(
78
103
  to_name, "exception_caught_tb", expression, emit, context
79
104
  ) as value_name:
80
- if keeper_variables[2] is None:
105
+ if keeper_exception_state_name is None:
81
106
  if python_version < 0x3B0:
82
- emit(
83
- "%s = (PyObject *)EXC_TRACEBACK(PyThreadState_GET());"
84
- % (value_name,)
85
- )
107
+ emit("%s = (PyObject *)EXC_TRACEBACK(tstate);" % (value_name,))
86
108
  else:
87
109
  emit(
88
- "%s = (PyObject *)GET_EXCEPTION_TRACEBACK(EXC_VALUE(PyThreadState_GET()));"
89
- % (value_name,)
110
+ """\
111
+ %(value_name)s = (PyObject *)GET_EXCEPTION_TRACEBACK(EXC_VALUE(tstate));
112
+ if (%(value_name)s == NULL) {
113
+ %(value_name)s = Py_None;
114
+ }"""
115
+ % {"value_name": value_name}
90
116
  )
117
+
91
118
  else:
92
119
  emit(
93
120
  """\
94
- if (%(keeper_tb)s != NULL) {
95
- %(to_name)s = (PyObject *)%(keeper_tb)s;
121
+ if (%(keeper_exception_state_name)s.exception_tb != NULL) {
122
+ %(to_name)s = (PyObject *)%(keeper_exception_state_name)s.exception_tb;
96
123
  Py_INCREF(%(to_name)s);
97
124
  } else {
98
125
  %(to_name)s = (PyObject *)%(tb_making)s;
@@ -100,9 +127,9 @@ if (%(keeper_tb)s != NULL) {
100
127
  """
101
128
  % {
102
129
  "to_name": value_name,
103
- "keeper_tb": keeper_variables[2],
130
+ "keeper_exception_state_name": keeper_exception_state_name,
104
131
  "tb_making": getTracebackMakingIdentifier(
105
- context=context, lineno_name=keeper_variables[3]
132
+ context=context, lineno_name=keeper_lineno
106
133
  ),
107
134
  }
108
135
  )
@@ -111,12 +138,13 @@ if (%(keeper_tb)s != NULL) {
111
138
 
112
139
 
113
140
  def getExceptionUnpublishedReleaseCode(emit, context):
114
- keeper_variables = context.getExceptionKeeperVariables()
141
+ (
142
+ keeper_exception_state_name,
143
+ _keeper_lineno,
144
+ ) = context.getExceptionKeeperVariables()
115
145
 
116
- if keeper_variables[0] is not None:
117
- emit("Py_DECREF(%s);" % keeper_variables[0])
118
- emit("Py_XDECREF(%s);" % keeper_variables[1])
119
- emit("Py_XDECREF(%s);" % keeper_variables[2])
146
+ if keeper_exception_state_name is not None:
147
+ emit("RELEASE_ERROR_OCCURRED_STATE(&%s);" % keeper_exception_state_name)
120
148
 
121
149
 
122
150
  def generateExceptionPublishCode(statement, emit, context):
@@ -124,11 +152,9 @@ def generateExceptionPublishCode(statement, emit, context):
124
152
 
125
153
  # Current variables cannot be used anymore now.
126
154
  (
127
- keeper_type,
128
- keeper_value,
129
- keeper_tb,
155
+ keeper_exception_state_name,
130
156
  keeper_lineno,
131
- ) = context.setExceptionKeeperVariables((None, None, None, None))
157
+ ) = context.setExceptionKeeperVariables((None, None))
132
158
 
133
159
  emit(
134
160
  template_publish_exception_to_handler
@@ -136,7 +162,7 @@ def generateExceptionPublishCode(statement, emit, context):
136
162
  "tb_making": getTracebackMakingIdentifier(
137
163
  context=context, lineno_name=keeper_lineno
138
164
  ),
139
- "keeper_tb": keeper_tb,
165
+ "keeper_exception_state_name": keeper_exception_state_name,
140
166
  "keeper_lineno": keeper_lineno,
141
167
  "frame_identifier": context.getFrameHandle(),
142
168
  }
@@ -144,15 +170,44 @@ def generateExceptionPublishCode(statement, emit, context):
144
170
 
145
171
  # TODO: Make this one thing for performance with thread state shared, also for less code,
146
172
  # then we should not make it in header anymore. Might be more scalable too.
147
- emit(
148
- "PUBLISH_CURRENT_EXCEPTION(tstate, &%s, &%s, &%s);"
149
- % (keeper_type, keeper_value, keeper_tb)
150
- )
173
+ emit("PUBLISH_CURRENT_EXCEPTION(tstate, &%s);" % keeper_exception_state_name)
174
+
175
+
176
+ def _attachExceptionAttributeCode(
177
+ to_name,
178
+ attribute_expression,
179
+ c_type_name,
180
+ c_attribute_name,
181
+ base_name_str,
182
+ emit,
183
+ context,
184
+ ):
185
+ if attribute_expression is not None:
186
+ from .PythonAPICodes import getReferenceExportCode
187
+
188
+ exception_attribute_name = context.allocateTempName(
189
+ base_name_str + "_" + c_attribute_name
190
+ )
151
191
 
192
+ generateExpressionCode(
193
+ to_name=exception_attribute_name,
194
+ expression=attribute_expression,
195
+ emit=emit,
196
+ context=context,
197
+ allow_none=True,
198
+ )
152
199
 
153
- def generateBuiltinMakeExceptionCode(to_name, expression, emit, context):
154
- # We try to make optimal code for various cases, pylint: disable=too-many-locals
200
+ getReferenceExportCode(exception_attribute_name, emit, context)
201
+ if context.needsCleanup(exception_attribute_name):
202
+ context.removeCleanupTempName(exception_attribute_name)
155
203
 
204
+ emit(
205
+ "((%s *)%s)->%s = %s;"
206
+ % (c_type_name, to_name, c_attribute_name, exception_attribute_name)
207
+ )
208
+
209
+
210
+ def _generateBuiltinMakeExceptionCode(to_name, expression, for_raise, emit, context):
156
211
  from .CallCodes import getCallCodeNoArgs, getCallCodePosArgsQuick
157
212
 
158
213
  exception_arg_names = []
@@ -174,10 +229,27 @@ def generateBuiltinMakeExceptionCode(to_name, expression, emit, context):
174
229
  with withObjectCodeTemporaryAssignment(
175
230
  to_name, "exception_made", expression, emit, context
176
231
  ) as value_name:
177
- if exception_arg_names:
232
+ exception_name = getExceptionIdentifier(exception_type)
233
+
234
+ if len(exception_arg_names) == 1 and for_raise:
235
+ emit(
236
+ "%s = MAKE_EXCEPTION_WITH_VALUE(tstate, %s, %s);"
237
+ % (value_name, exception_name, exception_arg_names[0])
238
+ )
239
+
240
+ getErrorExitCode(
241
+ check_name=value_name,
242
+ release_names=exception_arg_names,
243
+ needs_check=expression.mayRaiseExceptionOperation(),
244
+ emit=emit,
245
+ context=context,
246
+ )
247
+
248
+ context.addCleanupTempName(value_name)
249
+ elif exception_arg_names:
178
250
  getCallCodePosArgsQuick(
179
251
  to_name=value_name,
180
- called_name=getExceptionIdentifier(exception_type),
252
+ called_name=exception_name,
181
253
  expression=expression,
182
254
  arg_names=exception_arg_names,
183
255
  emit=emit,
@@ -187,69 +259,66 @@ def generateBuiltinMakeExceptionCode(to_name, expression, emit, context):
187
259
  else:
188
260
  getCallCodeNoArgs(
189
261
  to_name=value_name,
190
- called_name=getExceptionIdentifier(exception_type),
262
+ called_name=exception_name,
191
263
  expression=expression,
192
264
  emit=emit,
193
265
  context=context,
194
266
  )
195
267
 
196
- if exception_type == "ImportError" and python_version >= 0x300:
197
- is_new_import_error = True
198
- elif exception_type == "ModuleNotFoundError" and python_version >= 0x360:
199
- is_new_import_error = True
200
- else:
201
- is_new_import_error = False
202
-
203
- if is_new_import_error:
204
- from .PythonAPICodes import getReferenceExportCode
205
-
206
- import_error_name_expression = expression.subnode_name
207
-
208
- if import_error_name_expression is not None:
209
- exception_importerror_name = context.allocateTempName(
210
- "make_exception_importerror_name"
211
- )
212
-
213
- generateExpressionCode(
214
- to_name=exception_importerror_name,
215
- expression=import_error_name_expression,
216
- emit=emit,
217
- context=context,
218
- allow_none=True,
219
- )
220
-
221
- getReferenceExportCode(exception_importerror_name, emit, context)
222
- if context.needsCleanup(exception_importerror_name):
223
- context.removeCleanupTempName(exception_importerror_name)
224
-
225
- emit(
226
- "((PyImportErrorObject *)%s)->name = %s;"
227
- % (to_name, exception_importerror_name)
228
- )
268
+ if (
269
+ expression.isExpressionBuiltinMakeExceptionImportError()
270
+ or expression.isExpressionBuiltinMakeExceptionModuleNotFoundError()
271
+ ):
272
+ _attachExceptionAttributeCode(
273
+ to_name=to_name,
274
+ attribute_expression=expression.subnode_name,
275
+ base_name_str="exception_import_error",
276
+ c_type_name="PyImportErrorObject",
277
+ c_attribute_name="name",
278
+ emit=emit,
279
+ context=context,
280
+ )
229
281
 
230
- import_error_path_expression = expression.subnode_path
282
+ _attachExceptionAttributeCode(
283
+ to_name=to_name,
284
+ attribute_expression=expression.subnode_path,
285
+ base_name_str="exception_import_error",
286
+ c_type_name="PyImportErrorObject",
287
+ c_attribute_name="path",
288
+ emit=emit,
289
+ context=context,
290
+ )
231
291
 
232
- if import_error_path_expression is not None:
233
- exception_importerror_path = context.allocateTempName(
234
- "make_exception_importerror_path"
235
- )
292
+ elif expression.isExpressionBuiltinMakeExceptionAttributeError():
293
+ _attachExceptionAttributeCode(
294
+ to_name=to_name,
295
+ attribute_expression=expression.subnode_name,
296
+ base_name_str="exception_import_error",
297
+ c_type_name="PyAttributeErrorObject",
298
+ c_attribute_name="name",
299
+ emit=emit,
300
+ context=context,
301
+ )
236
302
 
237
- generateExpressionCode(
238
- to_name=exception_importerror_path,
239
- expression=import_error_path_expression,
240
- emit=emit,
241
- context=context,
242
- allow_none=True,
243
- )
303
+ _attachExceptionAttributeCode(
304
+ to_name=to_name,
305
+ attribute_expression=expression.subnode_obj,
306
+ base_name_str="exception_import_error",
307
+ c_type_name="PyAttributeErrorObject",
308
+ c_attribute_name="obj",
309
+ emit=emit,
310
+ context=context,
311
+ )
244
312
 
245
- getReferenceExportCode(exception_importerror_path, emit, context)
246
- if context.needsCleanup(exception_importerror_path):
247
- context.removeCleanupTempName(exception_importerror_path)
248
313
 
249
- emit(
250
- "((PyImportErrorObject *)%s)->path = %s;"
251
- % (to_name, exception_importerror_path)
252
- )
314
+ def generateBuiltinMakeExceptionCode(to_name, expression, emit, context):
315
+ _generateBuiltinMakeExceptionCode(
316
+ to_name=to_name,
317
+ expression=expression,
318
+ for_raise=expression.for_raise,
319
+ emit=emit,
320
+ context=context,
321
+ )
253
322
 
254
323
 
255
324
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -20,26 +20,39 @@ from nuitka.nodes.shapes.BuiltinTypeShapes import (
20
20
  from nuitka.PythonVersions import (
21
21
  isPythonValidCLongValue,
22
22
  isPythonValidDigitValue,
23
- python_version,
24
23
  )
25
24
 
26
25
  from .c_types.CTypeCFloats import CTypeCFloat
27
26
  from .c_types.CTypeCLongs import CTypeCLong, CTypeCLongDigit
27
+ from .c_types.CTypeNuitkaInts import CTypeNuitkaIntOrLongStruct
28
28
  from .c_types.CTypePyObjectPointers import CTypePyObjectPtr
29
+ from .VariableCodes import getLocalVariableDeclaration
29
30
 
30
31
 
31
- def _pickIntFamilyType(expression):
32
+ def _pickIntFamilyType(expression, context):
32
33
  if expression.isCompileTimeConstant():
33
- # On Python2, "INT_CLONG" is very fast as "CLONG" is the internal representation
34
- # of it, for Python3, it should be avoided, it usually is around 2**30.
35
- if python_version < 0x300:
36
- c_type = CTypeCLong
37
- elif isPythonValidDigitValue(expression.getCompileTimeConstant()):
34
+ if isPythonValidDigitValue(expression.getCompileTimeConstant()):
38
35
  c_type = CTypeCLongDigit
39
36
  elif isPythonValidCLongValue(expression.getCompileTimeConstant()):
40
37
  c_type = CTypeCLong
41
38
  else:
42
39
  c_type = CTypePyObjectPtr
40
+ elif expression.isExpressionVariableRefOrTempVariableRef():
41
+ # TODO: Module variables are not doing it (yet?)
42
+ variable = expression.getVariable()
43
+
44
+ # TODO: Closure variables should be possible to have non
45
+ # CTypePyObjectPtr eventually.
46
+ if variable.isLocalVariable() and not variable.isSharedTechnically():
47
+ variable_declaration = getLocalVariableDeclaration(
48
+ context=context,
49
+ variable=expression.getVariable(),
50
+ variable_trace=expression.getVariableTrace(),
51
+ )
52
+
53
+ c_type = variable_declaration.getCType()
54
+ else:
55
+ c_type = CTypePyObjectPtr
43
56
  else:
44
57
  c_type = CTypePyObjectPtr
45
58
 
@@ -84,6 +97,8 @@ _long_argument_normalization = {
84
97
  (CTypeCLong, CTypePyObjectPtr): True,
85
98
  (CTypePyObjectPtr, CTypeCLongDigit): False,
86
99
  (CTypeCLongDigit, CTypePyObjectPtr): True,
100
+ (CTypeNuitkaIntOrLongStruct, CTypeCLongDigit): False,
101
+ (CTypeCLongDigit, CTypeNuitkaIntOrLongStruct): True,
87
102
  }
88
103
 
89
104
  _str_argument_normalization = {
@@ -95,7 +110,7 @@ _bytes_argument_normalization = {
95
110
  }
96
111
 
97
112
 
98
- def decideExpressionCTypes(left, right, may_swap_arguments):
113
+ def decideExpressionCTypes(left, right, may_swap_arguments, context):
99
114
  # Complex stuff with many cases, pylint: disable=too-many-branches
100
115
 
101
116
  left_shape = left.getTypeShape()
@@ -104,8 +119,8 @@ def decideExpressionCTypes(left, right, may_swap_arguments):
104
119
  if left_shape in _int_types_family and right_shape in _int_types_family:
105
120
  may_swap_arguments = may_swap_arguments in ("number", "always")
106
121
 
107
- left_c_type = _pickIntFamilyType(left)
108
- right_c_type = _pickIntFamilyType(right)
122
+ left_c_type = _pickIntFamilyType(left, context)
123
+ right_c_type = _pickIntFamilyType(right, context)
109
124
 
110
125
  needs_argument_swap = (
111
126
  may_swap_arguments