# HG changeset patch # User Raphaël Gomès # Date 1619020754 -7200 # Node ID fceccc36873decb6614c47ff38f0b4f22aecfaff # Parent e050efe97fbe4fec7d0d02b95c46cbbc9d05737e 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 diff -r e050efe97fbe -r fceccc36873d 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: