mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
use a proper test instead of catching every exception
This commit is contained in:
parent
30ca04022f
commit
c1f8a06c2d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user