Changeset 4336


Ignore:
Timestamp:
Feb 8, 2010, 9:41:59 AM (7 years ago)
Author:
pterjan
Message:

Support python 2.6, and ask for 2.4 as it is accepted

Location:
neercs/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/configure.ac

    r4222 r4336  
    114114  PYTHON_CFLAGS="${PYTHON3_CFLAGS}"
    115115  PYTHON_LIBS="${PYTHON3_LIBS}"
    116   AC_DEFINE(HAVE_PYTHON3, 1, [Define to 1 if Python 3 is present])],
    117  [AC_PATH_PROG(PYTHON_CONFIG, python2.5-config, no)
     116  AC_DEFINE(HAVE_PYTHON3, 1, [Define to 1 if Python 3 is present])
     117  AC_DEFINE(HAVE_PYTHON26, 1, [Define to 1 if Python >= 2.6 is present])],
     118 [AC_PATH_PROG(PYTHON_CONFIG, python2.6-config, no)
     119  if test "${PYTHON_CONFIG}" = "no"; then
     120    AC_PATH_PROG(PYTHON_CONFIG, python2.5-config, no)
     121  else
     122    AC_DEFINE(HAVE_PYTHON26, 1, [Define to 1 if Python >= 2.6 is present])
     123  fi
    118124  if test "${PYTHON_CONFIG}" = "no"; then
    119125    AC_PATH_PROG(PYTHON_CONFIG, python2.4-config, no)
     
    128134    AC_DEFINE(USE_PYTHON, 1, [Define to 1 to use Python interpreter])
    129135  else
    130     AC_MSG_RESULT(you need Python 2.5 or later to compile the interpreter)
     136    AC_MSG_RESULT(you need Python 2.4 or later to compile the interpreter)
    131137  fi
    132138fi
  • neercs/trunk/src/python/interpreter.c

    r4165 r4336  
    4242static char *getPythonError(void);
    4343
    44 #if defined HAVE_PYTHON2
     44#if ! defined HAVE_PYTHON26
    4545static PyObject *PyUnicode_FromString(char const *str)
    4646{
     
    188188    PyObject *str = PyObject_Repr(p);
    189189    char *tmp;
    190 #if defined HAVE_PYTHON3
     190#if defined HAVE_PYTHON26
    191191    tmp = PyBytes_AS_STRING(PyUnicode_AsEncodedString(str, "utf-8", "Error ~"));
    192 #elif defined HAVE_PYTHON2
     192#else
    193193    tmp = PyString_AsString(str);
    194194#endif
Note: See TracChangeset for help on using the changeset viewer.