From c654f0acf91eb38a312c12dcaf6902c14dcfc885 Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Sun, 29 Jan 2017 10:17:17 +0000 Subject: =?UTF-8?q?Issues=20#29349:=20Add=20NEWS=20for=203.7;=20use=20?= =?UTF-8?q?=E2=80=9Cwith=E2=80=9D=20statement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Doc/tools/extensions/patchlevel.py | 5 +---- Misc/NEWS | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Doc/tools/extensions/patchlevel.py b/Doc/tools/extensions/patchlevel.py index 9558b9c..9ba32bd 100644 --- a/Doc/tools/extensions/patchlevel.py +++ b/Doc/tools/extensions/patchlevel.py @@ -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']) diff --git a/Misc/NEWS b/Misc/NEWS index add8d74..8e7b242 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -663,6 +663,8 @@ C API Documentation ------------- +- Issue #29349: Fix Python 2 syntax in code for building the documentation. + - Issue #23722: The data model reference and the porting section in the 3.6 What's New guide now cover the additional ``__classcell__`` handling needed for custom metaclasses to fully support PEP 487 and zero-argument -- cgit v0.12