Skip to content

Commit

Permalink
pythongh-114272: Allow _wmi audit test to succeed even if it times out
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Jan 26, 2024
1 parent 841eacd commit 4c15eaa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Lib/test/audit-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,13 @@ def hook(event, args):
print(event, args[0])

sys.addaudithook(hook)
_wmi.exec_query("SELECT * FROM Win32_OperatingSystem")
try:
_wmi.exec_query("SELECT * FROM Win32_OperatingSystem")
except WindowsError as e:
# gh-112278: WMI may be slow response when first called, but we still
# get the audit event, so just ignore the timeout
if e.winerror != 258:
raise

def test_syslog():
import syslog
Expand Down

0 comments on commit 4c15eaa

Please sign in to comment.