# HG changeset patch # User Augie Fackler # Date 2019-10-05 15:56:35 # Node ID 3b8a4587a456a7c4a3cd525e4f6c5967f820ef08 # Parent da3329fe01e3044f14223eeb8c6dd07842e495ad cvsps: switch a file open to a with statement For some reason this only showed up in check-code after running black. Puzzling. Differential Revision: https://phab.mercurial-scm.org/D6984 diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -138,7 +138,8 @@ def createlog(ui, directory=None, root=" # Get the real directory in the repository try: - prefix = open(os.path.join('CVS','Repository'), 'rb').read().strip() + with open(os.path.join(b'CVS', b'Repository'), 'rb') as f: + prefix = f.read().strip() directory = prefix if prefix == ".": prefix = ""