# HG changeset patch # User Augie Fackler # Date 1351225356 18000 # Node ID 9f919924bf8184ea2ba6822d34001b0b8488a64a # Parent 9c71a6f00863434faa5b776370b340fb2d0f4050# Parent cac070a4b5219b86d4999722bbe1ca7f34e55697 Merge diff --git a/hggit/git_handler.py b/hggit/git_handler.py --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -133,15 +133,17 @@ def init_author_file(self): self.author_map = {} if self.ui.config('git', 'authors'): - with open(self.repo.wjoin( - self.ui.config('git', 'authors') - )) as f: + f = open(self.repo.wjoin( + self.ui.config('git', 'authors'))) + try: 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