#3580: fix a failure in test_os
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 7cfae44..b644bdc 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -313,7 +313,7 @@
             try:
                 os.stat(r"c:\pagefile.sys")
             except WindowsError, e:
-                if e == 2: # file does not exist; cannot run test
+                if e.errno == 2: # file does not exist; cannot run test
                     return
                 self.fail("Could not stat pagefile.sys")