Merged revisions 55184-55224 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/p3yk

........
  r55186 | guido.van.rossum | 2007-05-08 10:37:51 -0700 (Tue, 08 May 2007) | 2 lines

  Don't die if /dev/tty doesn't exist; just skip that part of the test.
........
  r55204 | guido.van.rossum | 2007-05-09 10:55:11 -0700 (Wed, 09 May 2007) | 3 lines

  Fix a segfault when b"" was passed to b2a_qp() -- it was using strchr()
  instead of memchr().  Please backport; the original code was clearly wrong.
........
  r55221 | neal.norwitz | 2007-05-09 22:49:20 -0700 (Wed, 09 May 2007) | 1 line

  Always skip compiler and tranformer tests for now since they currently fail.
........
This commit is contained in:
Guido van Rossum 2007-05-10 14:04:07 +00:00
parent a4c612845a
commit 5205653a9e
2 changed files with 22 additions and 11 deletions

View file

@ -124,7 +124,14 @@ class OtherFileTests(unittest.TestCase):
self.assertEquals(f.isatty(), False)
f.close()
if not sys.platform.startswith("win"):
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)