[Request] [+ ] D10506: lint: fix failing code check

Alphare (Raphaël Gomès) phabricator at mercurial-scm.org
Wed Apr 28 15:08:07 UTC 2021


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

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:



To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20210428/d8482c4b/attachment-0001.html>


More information about the Mercurial-patches mailing list