Fix strange _DevNull instance has no attribute 'isatty' warnings that occur when...
authorZac Medico <zmedico@gentoo.org>
Thu, 7 Jun 2007 12:17:10 +0000 (12:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 7 Jun 2007 12:17:10 +0000 (12:17 -0000)
svn path=/main/trunk/; revision=6748

pym/portage/process.py

index 0cb175375cbf21f36bbc1cf53fef86c7e79397ce..c3f5d4df4e959ade9ef06f556a19803f4251fbb1 100644 (file)
@@ -112,7 +112,7 @@ def cleanup():
 atexit_register(cleanup)
 
 # Make sure the original terminal attributes are reverted at exit.
-if sys.stdin.isatty():
+if hasattr(sys.stdin, "isatty") and sys.stdin.isatty():
        import termios
        _stdin_termios = termios.tcgetattr(sys.stdin.fileno())
        def _reset_stdin_termios(stdin_termios):