From b1b3efc5049472829f586a57aa248afc131759cf Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 26 Mar 2008 23:24:27 +0000 Subject: [PATCH] Merged revisions 61954,61956-61957 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r61954 | christian.heimes | 2008-03-26 23:20:26 +0100 (Wed, 26 Mar 2008) | 1 line Surround p_flags access with #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD ........ r61956 | christian.heimes | 2008-03-26 23:51:58 +0100 (Wed, 26 Mar 2008) | 1 line Initialize PyCompilerFlags cf_flags with 0 ........ r61957 | christian.heimes | 2008-03-26 23:55:31 +0100 (Wed, 26 Mar 2008) | 1 line I forgot to svn add the future test ........ --- Lib/test/test_future4.py | 11 +++++++++++ Parser/parsetok.c | 1 + Python/import.c | 1 + Python/pythonrun.c | 1 + 4 files changed, 14 insertions(+) create mode 100644 Lib/test/test_future4.py diff --git a/Lib/test/test_future4.py b/Lib/test/test_future4.py new file mode 100644 index 00000000000000..5456449a725b6d --- /dev/null +++ b/Lib/test/test_future4.py @@ -0,0 +1,11 @@ +from __future__ import print_function +from __future__ import unicode_literals + +import unittest +from test import test_support + +def test_main(): + pass + +if __name__ == "__main__": + test_main() diff --git a/Parser/parsetok.c b/Parser/parsetok.c index 873be973ce6a4a..c6be8f9f2c1e5c 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -225,6 +225,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, } else n = NULL; + #ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD *flags = ps->p_flags; #endif diff --git a/Python/import.c b/Python/import.c index 33cb81c8dcdd8e..5b96cea545938f 100644 --- a/Python/import.c +++ b/Python/import.c @@ -826,6 +826,7 @@ parse_source_module(const char *pathname, FILE *fp) if (arena == NULL) return NULL; + flags.cf_flags = 0; mod = PyParser_ASTFromFile(fp, pathname, NULL, Py_file_input, 0, 0, &flags, NULL, arena); diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 5c17b695783ba6..08091b7939a698 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1568,6 +1568,7 @@ Py_SymtableString(const char *str, const char *filename, int start) if (arena == NULL) return NULL; + flags.cf_flags = 0; mod = PyParser_ASTFromString(str, filename, start, &flags, arena); if (mod == NULL) { PyArena_Free(arena);