mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
Issues #29349: Add NEWS for 3.7; use “with” statement
This commit is contained in:
parent
3a6dc19f6e
commit
c654f0acf9
2 changed files with 3 additions and 4 deletions
|
@ -22,15 +22,12 @@ def get_header_version_info(srcdir):
|
|||
rx = re.compile(r'\s*#define\s+([a-zA-Z][a-zA-Z_0-9]*)\s+([a-zA-Z_0-9]+)')
|
||||
|
||||
d = {}
|
||||
f = open(patchlevel_h)
|
||||
try:
|
||||
with open(patchlevel_h) as f:
|
||||
for line in f:
|
||||
m = rx.match(line)
|
||||
if m is not None:
|
||||
name, value = m.group(1, 2)
|
||||
d[name] = value
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
release = version = '%s.%s' % (d['PY_MAJOR_VERSION'], d['PY_MINOR_VERSION'])
|
||||
micro = int(d['PY_MICRO_VERSION'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue