mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105)
gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error
This commit is contained in:
parent
fb2e17b642
commit
186fa93876
1 changed files with 4 additions and 0 deletions
|
@ -24,6 +24,10 @@ class WindowsLoadTracker():
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
# make __del__ not fail if pre-flight test fails
|
||||||
|
self._running = None
|
||||||
|
self._stopped = None
|
||||||
|
|
||||||
# Pre-flight test for access to the performance data;
|
# Pre-flight test for access to the performance data;
|
||||||
# `PermissionError` will be raised if not allowed
|
# `PermissionError` will be raised if not allowed
|
||||||
winreg.QueryInfoKey(winreg.HKEY_PERFORMANCE_DATA)
|
winreg.QueryInfoKey(winreg.HKEY_PERFORMANCE_DATA)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue