Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c654f0a

Browse files
committed
Issues #29349: Add NEWS for 3.7; use “with” statement
1 parent 3a6dc19 commit c654f0a

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

Doc/tools/extensions/patchlevel.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ def get_header_version_info(srcdir):
2222
rx = re.compile(r'\s*#define\s+([a-zA-Z][a-zA-Z_0-9]*)\s+([a-zA-Z_0-9]+)')
2323

2424
d = {}
25-
f = open(patchlevel_h)
26-
try:
25+
with open(patchlevel_h) as f:
2726
for line in f:
2827
m = rx.match(line)
2928
if m is not None:
3029
name, value = m.group(1, 2)
3130
d[name] = value
32-
finally:
33-
f.close()
3431

3532
release = version = '%s.%s' % (d['PY_MAJOR_VERSION'], d['PY_MINOR_VERSION'])
3633
micro = int(d['PY_MICRO_VERSION'])

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,8 @@ C API
663663
Documentation
664664
-------------
665665

666+
- Issue #29349: Fix Python 2 syntax in code for building the documentation.
667+
666668
- Issue #23722: The data model reference and the porting section in the
667669
3.6 What's New guide now cover the additional ``__classcell__`` handling
668670
needed for custom metaclasses to fully support PEP 487 and zero-argument

0 commit comments

Comments
 (0)