Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-112278: reduce time cost for platform module when no permission to WMI on Windows#112658
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Lib/platform.py Outdated
global _wmi_query | ||
def _wmi_query(table, *keys): | ||
raise OSError("not supported") | ||
raise OSError("not supported") |
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.
Let's restructure this import block to make_wmi = None
when it fails to import, and then if we fail to query it can clear out_wmi
and subsequent calls will act as if it were never imported.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Updated, ready for review. |
Will add the backport to 3.12 after 3.12.1 has settled. |
Uh oh!
There was an error while loading.Please reload this page.
Using an
Event
object to simulate timeout forIWbemLocator::ConnectServer
. I set it to 100ms, and it's enough for the normal path on my machine. And there have another 100ms plus for waiting the query thread. The final time usage on my local machine: