Skip testing the special file "/dev/tty" on Windows. This test does

weird things if someone has a "\dev" directory on the current drive.
This commit is contained in:
Thomas Heller 2007-07-12 11:29:02 +00:00
parent fdeee3a6cd
commit b0f48abd87

View file

@ -124,12 +124,13 @@ class OtherFileTests(unittest.TestCase):
self.assertEquals(f.isatty(), False) self.assertEquals(f.isatty(), False)
f.close() f.close()
if sys.platform != "win32":
try: try:
f = _fileio._FileIO("/dev/tty", "a") f = _fileio._FileIO("/dev/tty", "a")
except EnvironmentError: except EnvironmentError:
# When run in a cron job there just aren't any ttys, # When run in a cron job there just aren't any
# so skip the test. This also handles Windows and # ttys, so skip the test. This also handles other
# other OS'es that don't support /dev/tty. # OS'es that don't support /dev/tty.
pass pass
else: else:
f = _fileio._FileIO("/dev/tty", "a") f = _fileio._FileIO("/dev/tty", "a")