From: Cory Benfield Date: Sat, 18 May 2013 09:35:04 +0000 (+0100) Subject: Trash debugsupport. X-Git-Tag: 2.7~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=447d3d27990d041bc3fa76eff36bc73b18519c81;p=thirdparty%2Fjinja.git Trash debugsupport. --- diff --git a/docs/intro.rst b/docs/intro.rst index 4ea65a83..60528e3f 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -14,16 +14,6 @@ Prerequisites Jinja2 works with Python 2.6.x, 2.7.x and >= 3.3. -FIXME - this is outdated, code should get removed, docs fixed: -Additionally a working C-compiler that can create python extensions should be -installed for the debugger if you are using Python 2.4. - -If you don't have a working C-compiler and you are trying to install the source -release with the debugsupport you will get a compiler error. - -.. _ctypes: http://python.net/crew/theller/ctypes/ - - Installation ------------ @@ -94,20 +84,6 @@ using Jinja2 with autoescaping. .. _MarkupSafe: http://pypi.python.org/pypi/MarkupSafe -Enable the debug support Module -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -By default Jinja2 will not compile the debug support module. Enabling this -will fail if you don't have the Python headers or a working compiler. This -is often the case if you are installing Jinja2 from a windows machine. - -FIXME - outdated: -Because the debug support is only necessary for Python 2.4 you will not -have to do this unless you run 2.4:: - - sudo python setup.py --with-debugsupport install - - Basic API Usage --------------- diff --git a/jinja2/_debugsupport.c b/jinja2/_debugsupport.c deleted file mode 100644 index e756d8e1..00000000 --- a/jinja2/_debugsupport.c +++ /dev/null @@ -1,78 +0,0 @@ -/** - * jinja2._debugsupport - * ~~~~~~~~~~~~~~~~~~~~ - * - * C implementation of `tb_set_next`. - * - * :copyright: (c) 2010 by the Jinja Team. - * :license: BSD. - */ - -#include - - -static PyObject* -tb_set_next(PyObject *self, PyObject *args) -{ - PyTracebackObject *tb, *old; - PyObject *next; - - if (!PyArg_ParseTuple(args, "O!O:tb_set_next", &PyTraceBack_Type, &tb, &next)) - return NULL; - if (next == Py_None) - next = NULL; - else if (!PyTraceBack_Check(next)) { - PyErr_SetString(PyExc_TypeError, - "tb_set_next arg 2 must be traceback or None"); - return NULL; - } - else - Py_INCREF(next); - - old = tb->tb_next; - tb->tb_next = (PyTracebackObject*)next; - Py_XDECREF(old); - - Py_INCREF(Py_None); - return Py_None; -} - -static PyMethodDef module_methods[] = { - {"tb_set_next", (PyCFunction)tb_set_next, METH_VARARGS, - "Set the tb_next member of a traceback object."}, - {NULL, NULL, 0, NULL} /* Sentinel */ -}; - - -#if PY_MAJOR_VERSION < 3 - -#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ -#define PyMODINIT_FUNC void -#endif -PyMODINIT_FUNC -init_debugsupport(void) -{ - Py_InitModule3("jinja2._debugsupport", module_methods, ""); -} - -#else /* Python 3.x module initialization */ - -static struct PyModuleDef module_definition = { - PyModuleDef_HEAD_INIT, - "jinja2._debugsupport", - NULL, - -1, - module_methods, - NULL, - NULL, - NULL, - NULL -}; - -PyMODINIT_FUNC -PyInit__debugsupport(void) -{ - return PyModule_Create(&module_definition); -} - -#endif diff --git a/jinja2/debug.py b/jinja2/debug.py index 55c12fe6..31c25ccc 100644 --- a/jinja2/debug.py +++ b/jinja2/debug.py @@ -331,10 +331,7 @@ def _init_ugly_crap(): tb_set_next = None if tproxy is None: try: - from jinja2._debugsupport import tb_set_next - except ImportError: - try: - tb_set_next = _init_ugly_crap() - except: - pass + tb_set_next = _init_ugly_crap() + except: + pass del _init_ugly_crap diff --git a/setup.py b/setup.py index 9c86487d..72c8c5b0 100644 --- a/setup.py +++ b/setup.py @@ -37,15 +37,7 @@ For more informations visit the new `Jinja2 webpage`_ and `documentation`_. """ import sys -from setuptools import setup, Extension, Feature - -debugsupport = Feature( - 'optional C debug support', - standard=False, - ext_modules = [ - Extension('jinja2._debugsupport', ['jinja2/_debugsupport.c']), - ], -) +from setuptools import setup # ignore the old '--with-speedups' flag @@ -54,11 +46,10 @@ try: except ValueError: pass else: - sys.argv[speedups_pos] = '--with-debugsupport' + sys.argv[speedups_pos] = '' sys.stderr.write('*' * 74 + '\n') sys.stderr.write('WARNING:\n') - sys.stderr.write(' the --with-speedups flag is deprecated, assuming ' - '--with-debugsupport\n') + sys.stderr.write(' the --with-speedups flag is deprecated\n') sys.stderr.write(' For the actual speedups install the MarkupSafe ' 'package.\n') sys.stderr.write('*' * 74 + '\n') @@ -97,6 +88,5 @@ setup( entry_points=""" [babel.extractors] jinja2 = jinja2.ext:babel_extract[i18n] - """, - features={'debugsupport': debugsupport} + """ )