Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 1837:6f67a4c93493
make ui flush output. this makes error happen if printing to /dev/full.
before this change, error happened with some pythons, but not others.
now always happens.
fixes issue 155.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 06 Mar 2006 08:35:15 -0800 |
parents | 3b1b44b917f4 |
children | d17f19d84fd3 |
comparison
equal
deleted
inserted
replaced
1836:cd5c1db2132a | 1837:6f67a4c93493 |
---|---|
130 def write_err(self, *args): | 130 def write_err(self, *args): |
131 if not sys.stdout.closed: sys.stdout.flush() | 131 if not sys.stdout.closed: sys.stdout.flush() |
132 for a in args: | 132 for a in args: |
133 sys.stderr.write(str(a)) | 133 sys.stderr.write(str(a)) |
134 | 134 |
135 def flush(self): | |
136 try: | |
137 sys.stdout.flush() | |
138 finally: | |
139 sys.stderr.flush() | |
140 | |
135 def readline(self): | 141 def readline(self): |
136 return sys.stdin.readline()[:-1] | 142 return sys.stdin.readline()[:-1] |
137 def prompt(self, msg, pat, default="y"): | 143 def prompt(self, msg, pat, default="y"): |
138 if not self.interactive: return default | 144 if not self.interactive: return default |
139 while 1: | 145 while 1: |