Index: configure.ac =================================================================== RCS file: /cvs/cairo/pycairo/configure.ac,v retrieving revision 1.67 retrieving revision 1.66 diff -u -r1.67 -r1.66 --- configure.ac 12 Dec 2007 12:14:19 -0000 1.67 +++ configure.ac 6 Apr 2007 08:38:44 -0000 1.66 @@ -34,7 +34,7 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE - used by autogen.sh -AM_PATH_PYTHON(2.4) +AM_PATH_PYTHON(2.3) # Checks for libraries --- Index: cairo/pycairo-private.h =================================================================== RCS file: /cvs/cairo/pycairo/cairo/pycairo-private.h,v retrieving revision 1.44 retrieving revision 1.43 diff -u -r1.44 -r1.43 --- cairo/pycairo-private.h 12 Dec 2007 12:14:19 -0000 1.44 +++ cairo/pycairo-private.h 16 Jan 2007 14:59:34 -0000 1.43 @@ -103,6 +103,21 @@ int Pycairo_Check_Status (cairo_status_t status); +/* Python 2.4 compatibility */ +#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION < 4 +# define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None +# define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True +# define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False +# define Py_CLEAR(op) \ + do { \ + if (op) { \ + PyObject *tmp = (PyObject *)(op); \ + (op) = NULL; \ + Py_DECREF(tmp); \ + } \ + } while (0) +#endif /* PY_MAJOR_VERSION */ + /* Python 2.5 compatibility */ #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; Index: test/test.py =================================================================== RCS file: /cvs/cairo/pycairo/test/test.py,v retrieving revision 1.3 retrieving revision 1.2 diff -u -r1.3 -r1.2 --- test/test.py 12 Dec 2007 12:14:19 -0000 1.3 +++ test/test.py 9 Apr 2005 02:58:43 -0000 1.2 @@ -8,11 +8,13 @@ def _test(): # check we are running from the test dir assert os.getcwd().endswith('/test'), "test.py must be run from the 'test' directory" - + runner = unittest.TextTestRunner() suite = doctest.DocFileSuite (__file__.replace ('.py', '.test')) runner.run(suite) if __name__ == "__main__": + if sys.version_info < (2,4): + raise SystemExit ("Python 2.4 or higher required") _test()