Mercurial > public > mercurial-scm > hg
diff hgext/convert/common.py @ 16688:cfb6682961b8
cleanup: replace naked excepts with more specific ones
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Sat, 12 May 2012 16:02:45 +0200 |
parents | e34106fa0dc3 |
children | fc24c10424d2 |
line wrap: on
line diff
--- a/hgext/convert/common.py Sat May 12 16:00:58 2012 +0200 +++ b/hgext/convert/common.py Sat May 12 16:02:45 2012 +0200 @@ -116,10 +116,10 @@ return s.encode("utf-8") try: return s.decode(encoding).encode("utf-8") - except: + except UnicodeError: try: return s.decode("latin-1").encode("utf-8") - except: + except UnicodeError: return s.decode(encoding, "replace").encode("utf-8") def getchangedfiles(self, rev, i): @@ -333,7 +333,7 @@ argmax = 4096 try: argmax = os.sysconf("SC_ARG_MAX") - except: + except (AttributeError, ValueError): pass # Windows shells impose their own limits on command line length,