# HG changeset patch # User Augie Fackler # Date 1343654408 18000 # Node ID 06f84f38c6dce928d4815f0a6349dbe64d7eaec0 # Parent ab8562b11c4fa58706fc3267bfa705326e495229 git_handler: clean up coding style diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -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