changeset 43839:3b8a4587a456

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
author Augie Fackler <augie@google.com>
date Sat, 05 Oct 2019 11:56:35 -0400
parents da3329fe01e3
children 9a3be115fb78
files hgext/convert/cvsps.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvsps.py
+++ b/hgext/convert/cvsps.py
@@ -138,7 +138,8 @@
 
         # 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 = ""