lint: fix failing code check stable
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 21 Apr 2021 17:59:14 +0200
branchstable
changeset 47007 fceccc36873d
parent 47006 e050efe97fbe
child 47008 77e73827a02d
lint: fix failing code check 8d2b62d716b0 introduced code that `test-check-code.t` wasn't happy about, this fixes it. Differential Revision: https://phab.mercurial-scm.org/D10506
setup.py
--- a/setup.py	Wed Apr 14 09:49:36 2021 -0400
+++ b/setup.py	Wed Apr 21 17:59:14 2021 +0200
@@ -438,7 +438,8 @@
     else:
         version = '0+hg' + kw.get('node', '')[:12]
 elif os.path.exists('mercurial/__version__.py'):
-    data = open('mercurial/__version__.py').read()
+    with open('mercurial/__version__.py') as f:
+        data = f.read()
     version = re.search('version = b"(.*)"', data).group(1)
 
 if version: