-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-40275: Remove duplicate import of locale module #19761
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
Conversation
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.
This PR goes somehow against https://bugs.python.org/issue40275 goal. I would prefer to move the top-level "import locale" into skip_if_buggy_ucrt_strfptime().
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
make sense, I updated this PR. |
Oh, the gate of macos failed randomly (no generated log file) |
It does not help. For the purpose of bpo-40275 the changes should reduce the list of imported modules. |
Maybe we could attempt to make locale import lazy in gettext, or make gettext import lazy in argparse. Or just give up because locale is less heavy than asyncio for example :-) |
I try to make local import lazy in gettext. I don't make gettext import lazy in argparse, because much function will call gettext in argpase(it's looks untidy). |
Lib/gettext.py
Outdated
@@ -46,7 +46,6 @@ | |||
# find this format documented anywhere. | |||
|
|||
|
|||
import locale | |||
import os |
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.
Please write a separated PR for gettext, and keep this PR for test.support.
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.
OK, I created #19905 to do this job.
This reverts commit 58d39a3.
|
https://bugs.python.org/issue40275