gh-106078: Isolate decimal module#107287
Conversation
|
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit 50d5243 🤖 If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
|
Following this PR, I now get a warning printed to my terminal whenever I run (I bisected the warning to this PR) |
| @@ -5857,7 +5876,7 @@ PyInit__decimal(void) | |||
| mpd_free = PyMem_Free; | |||
| mpd_setminalloc(_Py_DEC_MINALLOC); | |||
There was a problem hiding this comment.
Yes. The warning occures here, which is caused by the multi-phase initialization of decimal module. @AlexWaygood
This warning does not affect the module, because a static flag is used in mpd_setminalloc to ensure that MPD_MINALLOC can only be initialized once.
Maybe we can also add a static flag to the _decimal_exec to suppress this warning. But I'm not sure if it makes sense to do so (we add a static variable just to tell the compiler that we know a warning will be raised here). :)
There was a problem hiding this comment.
I think it is reasonable. Warnings are disrupting.
Convert decimal global state to true module state.
_decimalextension module #106078