# HG changeset patch # User Benoit Boissinot # Date 1142402982 -3600 # Node ID 16750010813d23a67daa41d408a3518ccdcbb46d # Parent f4df34b6987f59a849de72d68b29e5079c4a0ca1 use a proper test instead of catching every exception diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -789,14 +789,12 @@ def rcpath(): _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