]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105)
authorPetr Viktorin <encukou@gmail.com>
Thu, 29 Feb 2024 10:40:18 +0000 (11:40 +0100)
committerGitHub <noreply@github.com>
Thu, 29 Feb 2024 10:40:18 +0000 (11:40 +0100)
gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error

Lib/test/libregrtest/win_utils.py

index 5736cdfd3c72926630acfa5c465a83fe5392c757..b51fde0af57d1ff6d17a82c62621b2bdb844d094 100644 (file)
@@ -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)