From f4e1fb4d3608b3699f1bbe2f4210dd1b96bbe573 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Mon, 9 Jun 2008 18:54:56 +0200 Subject: [PATCH] small fix for Python 2.4 --HG-- branch : trunk --- jinja2/_speedups.c | 7 +++++++ setup.py | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/jinja2/_speedups.c b/jinja2/_speedups.c index 8a9a108..61858ef 100644 --- a/jinja2/_speedups.c +++ b/jinja2/_speedups.c @@ -17,6 +17,13 @@ #define ESCAPED_CHARS_TABLE_SIZE 63 #define UNICHR(x) (((PyUnicodeObject*)PyUnicode_DecodeASCII(x, strlen(x), NULL))->str); +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#endif + + static PyObject* markup; static Py_ssize_t escaped_chars_delta_len[ESCAPED_CHARS_TABLE_SIZE]; static Py_UNICODE *escaped_chars_repl[ESCAPED_CHARS_TABLE_SIZE]; diff --git a/setup.py b/setup.py index ed3e974..f9f447d 100644 --- a/setup.py +++ b/setup.py @@ -28,14 +28,14 @@ Philosophy Application logic is for the controller but don't try to make the life for the template designer too hard by giving him too few functionality. -For more informations visit the new `jinja2 webpage`_ and `documentation`_. +For more informations visit the new `Jinja2 webpage`_ and `documentation`_. The `Jinja2 tip`_ is installable via `easy_install` with ``easy_install Jinja2==dev``. .. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security) .. _Django: http://www.djangoproject.com/ -.. _jinja2 webpage: http://jinja.pocoo.org/ +.. _Jinja2 webpage: http://jinja.pocoo.org/ .. _documentation: http://jinja.pocoo.org/2/documentation/ .. _Jinja2 tip: http://dev.pocoo.org/hg/jinja2-main/archive/tip.tar.gz#egg=Jinja2-dev """ -- 2.26.2