Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r70038:51832197b83d
Date: 2014-03-17 18:44 -0700
http://bitbucket.org/pypy/pypy/changeset/51832197b83d/

Log:    fix test_stat_exception on win32

diff --git a/pypy/module/posix/test/test_posix2.py 
b/pypy/module/posix/test/test_posix2.py
--- a/pypy/module/posix/test/test_posix2.py
+++ b/pypy/module/posix/test/test_posix2.py
@@ -178,17 +178,9 @@
         import sys
         import errno
         for fn in [self.posix.stat, self.posix.lstat]:
-            try:
-                fn("nonexistentdir/nonexistentfile")
-            except OSError, e:
-                assert e.errno == errno.ENOENT
-                assert e.filename == "nonexistentdir/nonexistentfile"
-                # On Windows, when the parent directory does not exist,
-                # the winerror is 3 (cannot find the path specified)
-                # instead of 2 (cannot find the file specified)
-                if sys.platform == 'win32':
-                    assert isinstance(e, WindowsError)
-                    assert e.winerror == 3
+            exc = raises(OSError, fn, "nonexistentdir/nonexistentfile")
+            assert exc.value.errno == errno.ENOENT
+            assert exc.value.filename == "nonexistentdir/nonexistentfile"
 
     if hasattr(__import__(os.name), "statvfs"):
         def test_statvfs(self):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to