# HG changeset patch # User Brodie Rao # Date 1336907851 -7200 # Node ID 7292a4618f468cada9fde9d705761243d81011a4 # Parent 1751d96d324f605ff7762408b67fb7ae26ed7dc3 cleanup: replace more naked excepts with more specific ones diff -r 1751d96d324f -r 7292a4618f46 mercurial/ui.py --- a/mercurial/ui.py Sun May 13 13:17:27 2012 +0200 +++ b/mercurial/ui.py Sun May 13 13:17:31 2012 +0200 @@ -488,9 +488,9 @@ 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 -r 1751d96d324f -r 7292a4618f46 mercurial/util.py --- a/mercurial/util.py Sun May 13 13:17:27 2012 +0200 +++ b/mercurial/util.py Sun May 13 13:17:31 2012 +0200 @@ -762,7 +762,7 @@ ofp.close() except: try: os.unlink(temp) - except: pass + except OSError: pass raise return temp diff -r 1751d96d324f -r 7292a4618f46 tests/tinyproxy.py --- a/tests/tinyproxy.py Sun May 13 13:17:27 2012 +0200 +++ b/tests/tinyproxy.py Sun May 13 13:17:31 2012 +0200 @@ -47,7 +47,7 @@ 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