Author: thomas.heller
Date: Thu Jul 12 13:29:02 2007
New Revision: 56312

Modified:
   python/branches/py3k-struni/Lib/test/test_fileio.py
Log:
Skip testing the special file "/dev/tty" on Windows.  This test does
weird things if someone has a "\dev" directory on the current drive.


Modified: python/branches/py3k-struni/Lib/test/test_fileio.py
==============================================================================
--- python/branches/py3k-struni/Lib/test/test_fileio.py (original)
+++ python/branches/py3k-struni/Lib/test/test_fileio.py Thu Jul 12 13:29:02 2007
@@ -124,22 +124,23 @@
             self.assertEquals(f.isatty(), False)
             f.close()
 
-            try:
-                f = _fileio._FileIO("/dev/tty", "a")
-            except EnvironmentError:
-                # When run in a cron job there just aren't any ttys,
-                # so skip the test.  This also handles Windows and
-                # other OS'es that don't support /dev/tty.
-                pass
-            else:
-                f = _fileio._FileIO("/dev/tty", "a")
-                self.assertEquals(f.readable(), False)
-                self.assertEquals(f.writable(), True)
-                if sys.platform != "darwin":
-                    # Somehow /dev/tty appears seekable on OSX
-                    self.assertEquals(f.seekable(), False)
-                self.assertEquals(f.isatty(), True)
-                f.close()
+            if sys.platform != "win32":
+                try:
+                    f = _fileio._FileIO("/dev/tty", "a")
+                except EnvironmentError:
+                    # When run in a cron job there just aren't any
+                    # ttys, so skip the test.  This also handles other
+                    # OS'es that don't support /dev/tty.
+                    pass
+                else:
+                    f = _fileio._FileIO("/dev/tty", "a")
+                    self.assertEquals(f.readable(), False)
+                    self.assertEquals(f.writable(), True)
+                    if sys.platform != "darwin":
+                        # Somehow /dev/tty appears seekable on OSX
+                        self.assertEquals(f.seekable(), False)
+                    self.assertEquals(f.isatty(), True)
+                    f.close()
         finally:
             os.unlink(TESTFN)
 
_______________________________________________
Python-3000-checkins mailing list
Python-3000-checkins@python.org
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to