8000 [3.12] gh-116103: Prevent error in WindowsLoadTracker.__del__ on perm… · python/cpython@845123d · GitHub
[go: up one dir, main page]

Skip to content

Commit 845123d

Browse files
[3.12] gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105) (GH-116120)
gh-116103: Prevent error in WindowsLoadTracker.__del__ on permission error (GH-116105) (cherry picked from commit 186fa93) gh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 6359141 commit 845123d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/libregrtest/win_utils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ class WindowsLoadTracker():
2424
"""
2525

2626
def __init__(self):
27+
# make __del__ not fail if pre-flight test fails
28+
self._running = None
29+
self._stopped = None
30+
2731
# Pre-flight test for access to the performance data;
2832
# `PermissionError` will be raised if not allowed
2933
winreg.QueryInfoKey(winreg.HKEY_PERFORMANCE_DATA)

0 commit comments

Comments
 (0)
0