# HG changeset patch # User cmlenz # Date 1232063168 0 # Node ID 44d18ebd7e468345eed94e6f42345fe0663dec43 # Parent 5c93aefcd93f557df2d9350d3d9d477057db08d9 Ported [995] to 0.5.x branch. diff --git a/genshi/_speedups.c b/genshi/_speedups.c --- a/genshi/_speedups.c +++ b/genshi/_speedups.c @@ -43,7 +43,7 @@ /* Markup class */ -PyAPI_DATA(PyTypeObject) MarkupType; +PyTypeObject MarkupType; /* declared later */ PyDoc_STRVAR(Markup__doc__, "Marks a string as being safe for inclusion in HTML/XML output without\n\ @@ -232,7 +232,8 @@ static char *kwlist[] = {"seq", "escape_quotes", 0}; PyObject *seq = NULL, *seq2, *tmp, *tmp2; char quotes = 1; - int n, i; + Py_ssize_t n; + int i; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|b", kwlist, &seq, "es)) { return NULL; @@ -310,7 +311,8 @@ Markup_mod(PyObject *self, PyObject *args) { PyObject *tmp, *tmp2, *ret, *args2; - int i, nargs = 0; + int i; + Py_ssize_t nargs = 0; PyObject *kwds = NULL; if (PyDict_Check(args)) { diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -40,23 +40,24 @@ def run(self): try: build_ext.run(self) - except DistutilsPlatformError: - self._unavailable() + except DistutilsPlatformError, e: + self._unavailable(e) def build_extension(self, ext): try: build_ext.build_extension(self, ext) global _speedup_available _speedup_available = True - except CCompilerError, x: - self._unavailable() + except CCompilerError, e: + self._unavailable(e) - def _unavailable(self): + def _unavailable(self, exc): print '*' * 70 print """WARNING: An optional C extension could not be compiled, speedups will not be available.""" print '*' * 70 + print exc if Feature: @@ -83,6 +84,7 @@ if bdist_egg: cmdclass['bdist_egg'] = my_bdist_egg + setup( name = 'Genshi', version = '0.5.2',