summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLudwig Hähne <pankrat@tigris.org>2009-04-14 14:36:26 (GMT)
committerLudwig Hähne <pankrat@tigris.org>2009-04-14 14:36:26 (GMT)
commit90f3408e564e6f153511e6aaedebc98e44049ef9 (patch)
treec5a91e603000a556ce0ae3e3f9dc3e6d46b0611b
parent51cff874f72bc4afe2eb60a928472dc1669eab88 (diff)
downloadSCons-90f3408e564e6f153511e6aaedebc98e44049ef9.zip
SCons-90f3408e564e6f153511e6aaedebc98e44049ef9.tar.gz
SCons-90f3408e564e6f153511e6aaedebc98e44049ef9.tar.bz2
Issue 2377: Check if isatty() exists before calling it
-rw-r--r--src/engine/SCons/Script/Main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py
index c70708d..fb9cbe5 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:')