https://github.com/python/cpython/commit/9db482c7d9b98456ebf1dc9fa27e67f3fc945817
commit: 9db482c7d9b98456ebf1dc9fa27e67f3fc945817
branch: 3.11
author: Miss Islington (bot) <[email protected]>
committer: encukou <[email protected]>
date: 2024-02-29T14:44:55Z
summary:

[3.11] gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission 
error (GH-116105) (GH-116121)

gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error 
(GH-116105)
(cherry picked from commit 186fa9387669bcba6d3974a99c012c2b2c6fb4ce)


gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a 
permission error

Co-authored-by: Petr Viktorin <[email protected]>

files:
M Lib/test/libregrtest/win_utils.py

diff --git a/Lib/test/libregrtest/win_utils.py 
b/Lib/test/libregrtest/win_utils.py
index 5736cdfd3c7292..b51fde0af57d1f 100644
--- a/Lib/test/libregrtest/win_utils.py
+++ b/Lib/test/libregrtest/win_utils.py
@@ -24,6 +24,10 @@ class WindowsLoadTracker():
     """
 
     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;
         # `PermissionError` will be raised if not allowed
         winreg.QueryInfoKey(winreg.HKEY_PERFORMANCE_DATA)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to