[pypy-svn] r78849 - pypy/branch/fast-forward/pypy/module/cpyext
afa at codespeak.net
afa at codespeak.net
Sun Nov 7 23:42:56 CET 2010
Author: afa
Date: Sun Nov 7 23:42:54 2010
New Revision: 78849
Modified:
pypy/branch/fast-forward/pypy/module/cpyext/pyerrors.py
Log:
PyTraceBack_Print, don't know how to test it :-(
Modified: pypy/branch/fast-forward/pypy/module/cpyext/pyerrors.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/cpyext/pyerrors.py (original)
+++ pypy/branch/fast-forward/pypy/module/cpyext/pyerrors.py Sun Nov 7 23:42:54 2010
@@ -241,3 +241,12 @@
def PyErr_Print(space):
"""Alias for PyErr_PrintEx(1)."""
PyErr_PrintEx(space, 1)
+
+ at cpython_api([PyObject, PyObject], rffi.INT_real, error=-1):
+def PyTraceBack_Print(space, w_tb, w_file):
+ space.call_method(w_file, "write", space.wrap(
+ 'Traceback (most recent call last):\n'))
+ w_traceback = space.call_method(space.builtin, '__import__',
+ space.wrap("traceback"))
+ space.call_method(w_traceback, "print_tb", w_tb, space.w_None, w_file)
+ return 0
More information about the Pypy-commit
mailing list