Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
9ad4e771
Commit
9ad4e771
authored
Dec 30, 2008
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix exec statement in Py3
parent
80b0fa4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+10
-1
No files found.
Cython/Compiler/Builtin.py
View file @
9ad4e771
...
@@ -181,7 +181,11 @@ static PyObject* __Pyx_PyRun(PyObject* o, PyObject* globals, PyObject* locals) {
...
@@ -181,7 +181,11 @@ static PyObject* __Pyx_PyRun(PyObject* o, PyObject* globals, PyObject* locals) {
s = PyUnicode_AsUTF8String(o);
s = PyUnicode_AsUTF8String(o);
if (!s) goto bad;
if (!s) goto bad;
o = s;
o = s;
#if PY_MAJOR_VERSION >= 3
} else if (!PyBytes_Check(o)) {
#else
} else if (!PyString_Check(o)) {
} else if (!PyString_Check(o)) {
#endif
/* FIXME: support file objects and code objects */
/* FIXME: support file objects and code objects */
PyErr_SetString(PyExc_TypeError,
PyErr_SetString(PyExc_TypeError,
"exec currently requires a string as code input.");
"exec currently requires a string as code input.");
...
@@ -189,7 +193,12 @@ static PyObject* __Pyx_PyRun(PyObject* o, PyObject* globals, PyObject* locals) {
...
@@ -189,7 +193,12 @@ static PyObject* __Pyx_PyRun(PyObject* o, PyObject* globals, PyObject* locals) {
}
}
result = PyRun_String(
result = PyRun_String(
PyString_AS_STRING(o), Py_file_input, globals, locals);
#if PY_MAJOR_VERSION >= 3
PyBytes_AS_STRING(o),
#else
PyString_AS_STRING(o),
#endif
Py_file_input, globals, locals);
Py_XDECREF(s);
Py_XDECREF(s);
return result;
return result;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment