summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2008-03-26 22:01:37 (GMT)
committerChristian Heimes <christian@cheimes.de>2008-03-26 22:01:37 (GMT)
commit3c60833e1e53f6239825b44f76fa22172feb1790 (patch)
treea8ebf8db7f226aaaa1a144e1b6361281374a169a /Python/import.c
parent0cb3e86c472828720bb36a8335f10b81389fb668 (diff)
downloadcpython-3c60833e1e53f6239825b44f76fa22172feb1790.zip
cpython-3c60833e1e53f6239825b44f76fa22172feb1790.tar.gz
cpython-3c60833e1e53f6239825b44f76fa22172feb1790.tar.bz2
Patch #2477: Added from __future__ import unicode_literals
The new PyParser_*Ex() functions are based on Neal's suggestion and initial patch. The new __future__ feature makes all '' and r'' unicode strings. b'' and br'' stay (byte) strings.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index ecbec15..95cd20d 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -818,11 +818,12 @@ parse_source_module(const char *pathname, FILE *fp)
{
PyCodeObject *co = NULL;
mod_ty mod;
+ PyCompilerFlags flags;
PyArena *arena = PyArena_New();
if (arena == NULL)
return NULL;
- mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, 0,
+ mod = PyParser_ASTFromFile(fp, pathname, Py_file_input, 0, 0, &flags,
NULL, arena);
if (mod) {
co = PyAST_Compile(mod, pathname, NULL, arena);