hgext/convert/common.py
changeset 16688 cfb6682961b8
parent 16687 e34106fa0dc3
child 17391 fc24c10424d2
--- 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,