Skip to content

Commit d4a8a33

Browse files
committed
Using errno
1 parent 7aa607a commit d4a8a33

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_winapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Test the Windows-only _winapi module
22

3+
import errno
34
import os
45
import pathlib
56
import re
@@ -170,7 +171,7 @@ def test_event_source_registration(self):
170171

171172
with self.assertRaises(OSError) as cm:
172173
_winapi.DeregisterEventSource(_winapi.INVALID_HANDLE_VALUE)
173-
self.assertEqual(cm.exception.winerror, 6)
174+
self.assertEqual(cm.exception.errno, errno.EBADF)
174175

175176
def test_report_event(self):
176177
source_name = "PythonTestEventSource"

0 commit comments

Comments
 (0)