comparison mercurial/util.py @ 2261:20cf545b4725

Check existance of sys.argv for the use from mod_python.
author Shun-ichi GOTO <shunichi.goto@gmail.com>
date Thu, 11 May 2006 08:48:36 -0700
parents 4a069064a39b
children 3d48eb68f3ee
comparison
equal deleted inserted replaced
2240:56fddd98fef5 2261:20cf545b4725
586 return rcs 586 return rcs
587 587
588 def os_rcpath(): 588 def os_rcpath():
589 '''return default os-specific hgrc search path''' 589 '''return default os-specific hgrc search path'''
590 path = [] 590 path = []
591 if len(sys.argv) > 0: 591 if len(getattr(sys, 'argv', [])) > 0:
592 path.extend(rcfiles(os.path.dirname(sys.argv[0]) + 592 path.extend(rcfiles(os.path.dirname(sys.argv[0]) +
593 '/../etc/mercurial')) 593 '/../etc/mercurial'))
594 path.extend(rcfiles('/etc/mercurial')) 594 path.extend(rcfiles('/etc/mercurial'))
595 path.append(os.path.expanduser('~/.hgrc')) 595 path.append(os.path.expanduser('~/.hgrc'))
596 path = [os.path.normpath(f) for f in path] 596 path = [os.path.normpath(f) for f in path]