Mercurial > hg
changeset 1956:16750010813d
use a proper test instead of catching every exception
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 15 Mar 2006 07:09:42 +0100 |
parents | f4df34b6987f |
children | 295010327271 |
files | mercurial/util.py |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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