use a proper test instead of catching every exception
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Wed, 15 Mar 2006 07:09:42 +0100
changeset 1956 16750010813d
parent 1952 f4df34b6987f
child 1957 295010327271
use a proper test instead of catching every exception
mercurial/util.py
--- a/mercurial/util.py	Tue Mar 14 21:42:32 2006 -0800
+++ b/mercurial/util.py	Wed Mar 15 07:09:42 2006 +0100
@@ -789,14 +789,12 @@
             _rcpath = []
             for p in os.environ['HGRCPATH'].split(os.pathsep):
                 if not p: continue
-                try:
+                if os.path.isdir(p):
                     for f in os.listdir(p):
                         if f.endswith('.rc'):
                             _rcpath.append(os.path.join(p, f))
-                    continue
-                except:
-                    pass
-                _rcpath.append(p)
+                else:
+                    _rcpath.append(p)
         else:
             _rcpath = os_rcpath()
     return _rcpath