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