diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-04-27 15:56:30 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-04-27 15:56:30 (GMT) |
commit | 0e1a5b49cff19e86d97eb0a9f0cf0c090514855a (patch) | |
tree | 86232a6f73e83f81f93d966b7215e0f5a48bdbb8 /Tools | |
parent | cfc1cc2996fd513aa96ff27060c36f3b5ea9dab5 (diff) | |
download | cpython-0e1a5b49cff19e86d97eb0a9f0cf0c090514855a.zip cpython-0e1a5b49cff19e86d97eb0a9f0cf0c090514855a.tar.gz cpython-0e1a5b49cff19e86d97eb0a9f0cf0c090514855a.tar.bz2 |
use wfile api
Diffstat (limited to 'Tools')
-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 c7fde10..5961a10 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: |