Skip to content

Commit

Permalink
pythongh-116103: Prevent error in WindowsLoadTracker.__del__ on permi…
Browse files Browse the repository at this point in the history
…ssion error (pythonGH-116105)

pythongh-116103: Prevent error in WindowsLoadTracker.__del__ if there was a permission error
  • Loading branch information
encukou authored and diegorusso committed Apr 17, 2024
1 parent 250bb5b commit b2a1d8a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Lib/test/libregrtest/win_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b2a1d8a

Please sign in to comment.