[Updated] D10506: lint: fix failing code check

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


Closed by commit rHGfceccc36873d: lint: fix failing code check (authored by Alphare).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D10506?vs=27154&id=27191#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D10506?vs=27154&id=27191

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D10506/new/

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,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:



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


More information about the Mercurial-patches mailing list