diff options
author | Brett Cannon <brett@python.org> | 2012-04-27 14:02:33 -0400 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-04-27 14:02:33 -0400 |
commit | 9e66ac683cce9f6e4abda7d01836dab70eeefb49 (patch) | |
tree | 4630a4702db51d0f90d5959d9157958592f46731 | |
parent | ce418b448f431f2e62f0517f337f5b6762f4ae45 (diff) | |
parent | 0e1a5b49cff19e86d97eb0a9f0cf0c090514855a (diff) | |
download | cpython-git-9e66ac683cce9f6e4abda7d01836dab70eeefb49.tar.gz |
merge
-rw-r--r-- | Tools/hg/hgtouch.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Tools/hg/hgtouch.py b/Tools/hg/hgtouch.py index c7fde1057d..5961a10ad0 100644 --- a/Tools/hg/hgtouch.py +++ b/Tools/hg/hgtouch.py @@ -7,15 +7,19 @@ syntax of make rules. In addition to the dependency syntax, #-comments are supported. """ +import errno import os def parse_config(repo): - configfile = repo.wjoin(".hgtouch") - if not os.path.exists(configfile): + try: + fp = repo.wfile(".hgtouch") + except IOError, e: + if e.errno != errno.ENOENT: + raise return {} result = {} - with open(configfile) as f: - for line in f: + with fp: + for line in fp: # strip comments line = line.split('#')[0].strip() if ':' not in line: |