cpython: 1729ec440bb6 (original) (raw)

Mercurial > cpython

changeset 75872:1729ec440bb6 2.7

check by equality for __future__ not identity (closes #14378) [#14378]

Benjamin Peterson benjamin@python.org
date Thu, 22 Mar 2012 08:19:04 -0400
parents 44a8385a8241
children ad5e93ae22ef
files Lib/test/test_ast.py Misc/NEWS Python/future.c
diffstat 3 files changed, 12 insertions(+), 8 deletions(-)[+] [-] Lib/test/test_ast.py 6 Misc/NEWS 3 Python/future.c 11

line wrap: on

line diff

--- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -231,6 +231,12 @@ class AST_Tests(unittest.TestCase): im = ast.parse("from . import y").body[0] self.assertIsNone(im.module)

+ def test_base_classes(self): self.assertTrue(issubclass(ast.For, ast.stmt)) self.assertTrue(issubclass(ast.Name, ast.expr))

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -9,6 +9,9 @@ What's New in Python 2.7.4 Core and Builtins ----------------- +- Issue #14378: Fix compiling ast.ImportFrom nodes with a "future" string as

--- a/Python/future.c +++ b/Python/future.c @@ -59,13 +59,6 @@ future_parse(PyFutureFeatures *ff, mod_t { int i, found_docstring = 0, done = 0, prev_line = 0;

- if (!(mod->kind == Module_kind || mod->kind == Interactive_kind)) return 1; @@ -92,7 +85,9 @@ future_parse(PyFutureFeatures *ff, mod_t */ if (s->kind == ImportFrom_kind) {