-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-106078: Suppress the warning caused by multi-phase initialization of decimal
#107524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-106078: Suppress the warning caused by multi-phase initialization of decimal
#107524
Conversation
Maybe we can skip news for this PR. |
It looks like the global variable check is failing, the tool cannot ignore static variables inside functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested it locally, and it works. Multiple imports of decimal
doesn't make any warnings anymore.
LGTM.
The warning that's being suppressed here was recently brought up again in #110266 |
See also the discussion about a global init/exit API for extension modules. |
|
…ation of `decimal` (python#107524)
This warnning is caused by the multi-phase initialization of
decimal
module. Whendecimal
module is repeatedly imported,decimal_exec
will be executed multiple times and this warning will be raised.See #107287 (comment) for details.
_decimal
extension module #106078