]> granicus.if.org Git - python/commitdiff
Issues #29349: Add NEWS for 3.7; use “with” statement
authorMartin Panter <vadmium+py@gmail.com>
Sun, 29 Jan 2017 10:17:17 +0000 (10:17 +0000)
committerMartin Panter <vadmium+py@gmail.com>
Sun, 29 Jan 2017 10:17:17 +0000 (10:17 +0000)
Doc/tools/extensions/patchlevel.py
Misc/NEWS

index 9558b9ce433c5b20028c618be44979f412897c0c..9ba32bd8b939e05e9d59142f77966924892d21c0 100644 (file)
@@ -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'])
index add8d744fa7020ea1bfa2fe21c75189bf81e3927..8e7b24296d0a2c22d1a282dc74dd2db17c7eacb4 100644 (file)
--- 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