comparison Python/pythonrun.c @ 51956:8fe2988cf550

ignore the coding cookie in compile(), exec(), and eval() if the source is a string #4626
author Benjamin Peterson <benjamin@python.org>
date Mon, 02 Mar 2009 23:31:26 +0000
parents 14c3ab9bd706
children 3049ac17e256
comparison
equal deleted inserted replaced
51955:116d90ef3164 51956:8fe2988cf550
1000 */ 1000 */
1001 } 1001 }
1002 } 1002 }
1003 1003
1004 /* compute parser flags based on compiler flags */ 1004 /* compute parser flags based on compiler flags */
1005 #define PARSER_FLAGS(flags) \ 1005 static int PARSER_FLAGS(PyCompilerFlags *flags)
1006 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ 1006 {
1007 PyPARSE_DONT_IMPLY_DEDENT : 0)) : 0) 1007 int parser_flags = 0;
1008 if (!flags)
1009 return 0;
1010 if (flags->cf_flags & PyCF_DONT_IMPLY_DEDENT)
1011 parser_flags |= PyPARSE_DONT_IMPLY_DEDENT;
1012 if (flags->cf_flags & PyCF_IGNORE_COOKIE)
1013 parser_flags |= PyPARSE_IGNORE_COOKIE;
1014 return parser_flags;
1015 }
1008 1016
1009 #if 0 1017 #if 0
1010 /* Keep an example of flags with future keyword support. */ 1018 /* Keep an example of flags with future keyword support. */
1011 #define PARSER_FLAGS(flags) \ 1019 #define PARSER_FLAGS(flags) \
1012 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \ 1020 ((flags) ? ((((flags)->cf_flags & PyCF_DONT_IMPLY_DEDENT) ? \