summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-26 20:28:21 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-26 20:28:21 (GMT)
commit14e461d5b92000ec4e89182fa25ab0d5b5b31234 (patch)
tree21e37d8661cbe50e7ddbedc1b35a486adc1eae87 /Python/bltinmodule.c
parent33824f6fd70f89dd39fcb7ed1651e8097c57d340 (diff)
downloadcpython-14e461d5b92000ec4e89182fa25ab0d5b5b31234.zip
cpython-14e461d5b92000ec4e89182fa25ab0d5b5b31234.tar.gz
cpython-14e461d5b92000ec4e89182fa25ab0d5b5b31234.tar.bz2
Close #11619: The parser and the import machinery do not encode Unicode
filenames anymore on Windows.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index fb3abae..11d9ee4 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -579,8 +579,7 @@ static PyObject *
builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
{
char *str;
- PyObject *filename_obj;
- char *filename;
+ PyObject *filename;
char *startstr;
int mode = -1;
int dont_inherit = 0;
@@ -596,12 +595,11 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&s|iii:compile", kwlist,
&cmd,
- PyUnicode_FSConverter, &filename_obj,
+ PyUnicode_FSDecoder, &filename,
&startstr, &supplied_flags,
&dont_inherit, &optimize))
return NULL;
- filename = PyBytes_AS_STRING(filename_obj);
cf.cf_flags = supplied_flags | PyCF_SOURCE_IS_UTF8;
if (supplied_flags &
@@ -659,8 +657,8 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
PyArena_Free(arena);
goto error;
}
- result = (PyObject*)PyAST_CompileEx(mod, filename,
- &cf, optimize, arena);
+ result = (PyObject*)PyAST_CompileObject(mod, filename,
+ &cf, optimize, arena);
PyArena_Free(arena);
}
goto finally;
@@ -670,13 +668,13 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
if (str == NULL)
goto error;
- result = Py_CompileStringExFlags(str, filename, start[mode], &cf, optimize);
+ result = Py_CompileStringObject(str, filename, start[mode], &cf, optimize);
goto finally;
error:
result = NULL;
finally:
- Py_DECREF(filename_obj);
+ Py_DECREF(filename);
return result;
}