mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
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.
This commit is contained in:
parent
0cb3e86c47
commit
3c60833e1e
12 changed files with 107 additions and 33 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue