Mercurial > hg > mercurial-source
diff mercurial/ui.py @ 10077:89617aacb495
make ui.interactive() return false in case stdin lacks isatty
author | Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de> |
---|---|
date | Sun, 13 Dec 2009 18:29:16 +0100 |
parents | 38170eeed18c |
children | 489b0caf21ed |
line wrap: on
line diff
--- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -253,7 +253,13 @@ def interactive(self): i = self.configbool("ui", "interactive", None) if i is None: - return sys.stdin.isatty() + try: + return sys.stdin.isatty() + except AttributeError: + # some environments replace stdin without implementing isatty + # usually those are non-interactive + return False + return i def _readline(self, prompt=''):