Mercurial > hg-git
changeset 742:06f84f38c6dc
git_handler: clean up coding style
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Mon, 30 Jul 2012 08:20:08 -0500 |
parents | ab8562b11c4f |
children | c7ea22aa3440 |
files | hggit/git_handler.py |
diffstat | 1 files changed, 1 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hggit/git_handler.py Fri Jul 04 15:46:49 2014 +0900 +++ b/hggit/git_handler.py Mon Jul 30 08:20:08 2012 -0500 @@ -136,17 +136,13 @@ def init_author_file(self): self.author_map = {} if self.ui.config('git', 'authors'): - f = open(self.repo.wjoin( - self.ui.config('git', 'authors'))) - try: + with open(self.repo.wjoin(self.ui.config('git', 'authors'))) as f: for line in f: line = line.strip() if not line or line.startswith('#'): continue from_, to = RE_AUTHOR_FILE.split(line, 2) self.author_map[from_] = to - finally: - f.close() ## FILE LOAD AND SAVE METHODS