]> granicus.if.org Git - python/commitdiff
Issue #25097: fix Windows error number access
authorZachary Ware <zachary.ware@gmail.com>
Tue, 6 Oct 2015 20:22:13 +0000 (15:22 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Tue, 6 Oct 2015 20:22:13 +0000 (15:22 -0500)
Lib/test/test_logging.py

index be3d02c44b7202ca468a26d6487f2067bd360f0c..f3df5346e1e9c968447ecfb23dc327b9971ea597 100644 (file)
@@ -4104,7 +4104,7 @@ class NTEventLogHandlerTest(BaseTest):
         try:
             h = logging.handlers.NTEventLogHandler('test_logging')
         except pywintypes.error as e:
-            if e[0] == 5:  # access denied
+            if e.winerror == 5:  # access denied
                 raise unittest.SkipTest('Insufficient privileges to run test')
 
         r = logging.makeLogRecord({'msg': 'Test Log Message'})