diff --git a/mercurial/ui.py b/mercurial/ui.py --- a/mercurial/ui.py +++ b/mercurial/ui.py @@ -488,9 +488,9 @@ class ui(object): def flush(self): try: self.fout.flush() - except: pass + except (IOError, ValueError): pass try: self.ferr.flush() - except: pass + except (IOError, ValueError): pass def interactive(self): '''is interactive input allowed? diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -762,7 +762,7 @@ def mktempcopy(name, emptyok=False, crea ofp.close() except: try: os.unlink(temp) - except: pass + except OSError: pass raise return temp diff --git a/tests/tinyproxy.py b/tests/tinyproxy.py --- a/tests/tinyproxy.py +++ b/tests/tinyproxy.py @@ -47,7 +47,7 @@ class ProxyHandler (BaseHTTPServer.BaseH try: soc.connect(host_port) except socket.error, arg: try: msg = arg[1] - except: msg = arg + except (IndexError, TypeError): msg = arg self.send_error(404, msg) return 0 return 1