Patchwork D10506: lint: fix failing code check

login
register
mail settings
Submitter phabricator
Date April 28, 2021, 3:08 p.m.
Message ID <differential-rev-PHID-DREV-pekftnczqtdadapncp64-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48827/
State Superseded
Headers show

Comments

phabricator - April 28, 2021, 3:08 p.m.
Alphare created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
Alphare added a comment.
pulkit accepted this revision.
This revision is now accepted and ready to land.


  /!\ Meant for stable /!\

REVISION SUMMARY
  8d2b62d716b0 <https://phab.mercurial-scm.org/rHG8d2b62d716b095507effaa8d56f87cd27ba659ab> introduced code that `test-check-code.t` wasn't happy about, this
  fixes it.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D10506

AFFECTED FILES
  setup.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -438,7 +438,9 @@ 
     else:
         version = '0+hg' + kw.get('node', '')[:12]
 elif os.path.exists('mercurial/__version__.py'):
-    data = open('mercurial/__version__.py').read()
+    f = open('mercurial/__version__.py')
+    data = f.read()
+    f.close()
     version = re.search('version = b"(.*)"', data).group(1)
 
 if version: