Mercurial > public > mercurial-scm > hg-stable
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 Tue Dec 15 10:45:24 2009 -0600 +++ b/mercurial/ui.py Sun Dec 13 18:29:16 2009 +0100 @@ -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=''):