Commit 16a8aa9e authored by Stefan Behnel's avatar Stefan Behnel

use print() function in PyPy instead of trying to get at sys.stdout for printing

--HG--
extra : rebase_source : 7b2bd9cdc5254609b97aa1e6a4b175e201064c40
parent 6e670e64
...@@ -8371,19 +8371,19 @@ else: ...@@ -8371,19 +8371,19 @@ else:
printing_utility_code = UtilityCode( printing_utility_code = UtilityCode(
proto = """ proto = """
static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/ static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* %s = 0; static PyObject* %s = 0;
static PyObject* %s = 0; static PyObject* %s = 0;
#endif #endif
""" % (Naming.print_function, Naming.print_function_kwargs), """ % (Naming.print_function, Naming.print_function_kwargs),
cleanup = """ cleanup = """
#if PY_MAJOR_VERSION >= 3 #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
Py_CLEAR(%s); Py_CLEAR(%s);
Py_CLEAR(%s); Py_CLEAR(%s);
#endif #endif
""" % (Naming.print_function, Naming.print_function_kwargs), """ % (Naming.print_function, Naming.print_function_kwargs),
impl = r""" impl = r"""
#if PY_MAJOR_VERSION < 3 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) { static PyObject *__Pyx_GetStdout(void) {
PyObject *f = PySys_GetObject((char *)"stdout"); PyObject *f = PySys_GetObject((char *)"stdout");
if (!f) { if (!f) {
...@@ -8493,7 +8493,7 @@ proto = """ ...@@ -8493,7 +8493,7 @@ proto = """
static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/ static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
""", """,
impl = r""" impl = r"""
#if PY_MAJOR_VERSION < 3 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) { static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
if (!f) { if (!f) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment