Skip to content

Commit 7d26942

Browse files
committed
Remove ReportEvent with invalid handle cuz it will crash the process on some environment
1 parent b167204 commit 7d26942

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

Lib/test/test_winapi.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,6 @@ def test_report_event(self):
185185
# Test with empty strings list
186186
_winapi.ReportEvent(handle, _winapi.EVENTLOG_AUDIT_FAILURE, 2, 1003, [])
187187

188-
with self.assertRaisesRegex(OSError, '[WinError 6]'):
189-
_winapi.ReportEvent(_winapi.INVALID_HANDLE_VALUE,
190-
_winapi.EVENTLOG_AUDIT_SUCCESS, 0, 1001, [],
191-
test_data)
192-
193188
with self.assertRaisesRegex(TypeError, 'All strings must be unicode'):
194-
_winapi.ReportEvent(handle, _winapi.EVENTLOG_SUCCESS, 0, 1001,
189+
_winapi.ReportEvent(handle, _winapi.EVENTLOG_ERROR_TYPE, 0, 1001,
195190
["string", 123])

0 commit comments

Comments
 (0)