aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Smith <eric@trueblade.com>2008-03-18 23:45:49 +0000
committerEric Smith <eric@trueblade.com>2008-03-18 23:45:49 +0000
commit7c47894a2aaa8dbc5397a256b16cd7deddef1d7e (patch)
tree8a04cef2a98907c1f20cde46f0efec77a5730a65 /Python/pythonrun.c
parentIssue: 2354: Add 3K warning for the cmp argument to list.sort() and sorted(). (diff)
downloadcpython-7c47894a2aaa8dbc5397a256b16cd7deddef1d7e.tar.gz
cpython-7c47894a2aaa8dbc5397a256b16cd7deddef1d7e.tar.bz2
cpython-7c47894a2aaa8dbc5397a256b16cd7deddef1d7e.zip
Backport of the print function, using a __future__ import.
This work is substantially Anthony Baxter's, from issue 1633807. I just freshened it, made a few minor tweaks, and added the test cases. I also created issue 2412, which is to check for 2to3's behavior with the print function. I also added myself to ACKS.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 298d21862f3..b8d516dd9c5 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -738,18 +738,19 @@ PyRun_InteractiveLoopFlags(FILE *fp, const char *filename, PyCompilerFlags *flag
}
}
+#if 0
/* compute parser flags based on compiler flags */
#define PARSER_FLAGS(flags) \
((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \
PyPARSE_DONT_IMPLY_DEDENT : 0)) : 0)
-
-#if 0
+#endif
+#if 1
/* Keep an example of flags with future keyword support. */
#define PARSER_FLAGS(flags) \
((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \
PyPARSE_DONT_IMPLY_DEDENT : 0) \
- | ((flags)->cf_flags & CO_FUTURE_WITH_STATEMENT ? \
- PyPARSE_WITH_IS_KEYWORD : 0)) : 0)
+ | ((flags)->cf_flags & CO_FUTURE_PRINT_FUNCTION ? \
+ PyPARSE_PRINT_IS_FUNCTION : 0)) : 0)
#endif
int