Index: Lib/test/test_os.py =================================================================== --- Lib/test/test_os.py (revision 55014) +++ Lib/test/test_os.py (working copy) @@ -236,7 +236,8 @@ try: os.stat(r"c:\pagefile.sys") except WindowsError, e: - if e == 2: # file does not exist; cannot run test + # If access is denied; cannot run test + if e.winerror == 5: return self.fail("Could not stat pagefile.sys")