From: pankrat Date: Tue, 14 Apr 2009 14:36:26 +0000 (+0000) Subject: Issue 2377: Check if isatty() exists before calling it X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6fe4d6b8dad23a0e7d13310d1be191d4c80cd2cf;p=scons.git Issue 2377: Check if isatty() exists before calling it git-svn-id: http://scons.tigris.org/svn/scons/trunk@4091 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index c70708d9..fb9cbe52 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -885,9 +885,9 @@ def _main(parser): # module will no longer work. This affects the behavior during # --interactive mode. --interactive should only be used when stdin and # stdout refer to a tty. - if not sys.stdout.isatty(): + if not hasattr(sys.stdout, 'isatty') or not sys.stdout.isatty(): sys.stdout = SCons.Util.Unbuffered(sys.stdout) - if not sys.stderr.isatty(): + if not hasattr(sys.stderr, 'isatty') or not sys.stderr.isatty(): sys.stderr = SCons.Util.Unbuffered(sys.stderr) memory_stats.append('before reading SConscript files:')