mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.948
Problem: Cannot build with Python 2.2 Solution: Make Python interface work with Python 2.2 Make 2.2 the first supported version. (ZyX)
This commit is contained in:
6
src/auto/configure
vendored
6
src/auto/configure
vendored
@@ -5289,10 +5289,10 @@ fi
|
|||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5
|
||||||
$as_echo "$vi_cv_var_python_version" >&6; }
|
$as_echo "$vi_cv_var_python_version" >&6; }
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 1.4 or better" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 2.2 or better" >&5
|
||||||
$as_echo_n "checking Python is 1.4 or better... " >&6; }
|
$as_echo_n "checking Python is 2.2 or better... " >&6; }
|
||||||
if ${vi_cv_path_python} -c \
|
if ${vi_cv_path_python} -c \
|
||||||
"import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
|
"import sys; sys.exit(${vi_cv_var_python_version} < 2.2)"
|
||||||
then
|
then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5
|
||||||
$as_echo "yep" >&6; }
|
$as_echo "yep" >&6; }
|
||||||
|
@@ -863,10 +863,10 @@ if test "$enable_pythoninterp" = "yes" -o "$enable_pythoninterp" = "dynamic"; th
|
|||||||
${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
|
${vi_cv_path_python} -c 'import sys; print sys.version[:3]'`
|
||||||
]])
|
]])
|
||||||
|
|
||||||
dnl -- it must be at least version 1.4
|
dnl -- it must be at least version 2.2
|
||||||
AC_MSG_CHECKING(Python is 1.4 or better)
|
AC_MSG_CHECKING(Python is 2.2 or better)
|
||||||
if ${vi_cv_path_python} -c \
|
if ${vi_cv_path_python} -c \
|
||||||
"import sys; sys.exit(${vi_cv_var_python_version} < 1.4)"
|
"import sys; sys.exit(${vi_cv_var_python_version} < 2.2)"
|
||||||
then
|
then
|
||||||
AC_MSG_RESULT(yep)
|
AC_MSG_RESULT(yep)
|
||||||
|
|
||||||
|
@@ -564,6 +564,7 @@ IterNew(void *start, destructorfun destruct, nextfun next)
|
|||||||
return (PyObject *)(self);
|
return (PyObject *)(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* unused */
|
||||||
static void
|
static void
|
||||||
IterDestructor(PyObject *self)
|
IterDestructor(PyObject *self)
|
||||||
{
|
{
|
||||||
@@ -573,6 +574,7 @@ IterDestructor(PyObject *self)
|
|||||||
|
|
||||||
DESTRUCTOR_FINISH(self);
|
DESTRUCTOR_FINISH(self);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
IterNext(PyObject *self)
|
IterNext(PyObject *self)
|
||||||
@@ -696,13 +698,7 @@ DictionarySetattr(PyObject *self, char *name, PyObject *val)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!PyBool_Check(val))
|
if (PyObject_IsTrue(val))
|
||||||
{
|
|
||||||
PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (val == Py_True)
|
|
||||||
this->dict->dv_lock = VAR_LOCKED;
|
this->dict->dv_lock = VAR_LOCKED;
|
||||||
else
|
else
|
||||||
this->dict->dv_lock = 0;
|
this->dict->dv_lock = 0;
|
||||||
@@ -1202,13 +1198,7 @@ ListSetattr(PyObject *self, char *name, PyObject *val)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!PyBool_Check(val))
|
if (PyObject_IsTrue(val))
|
||||||
{
|
|
||||||
PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (val == Py_True)
|
|
||||||
this->list->lv_lock = VAR_LOCKED;
|
this->list->lv_lock = VAR_LOCKED;
|
||||||
else
|
else
|
||||||
this->list->lv_lock = 0;
|
this->list->lv_lock = 0;
|
||||||
@@ -1484,14 +1474,8 @@ OptionsAssItem(OptionsObject *this, PyObject *keyObject, PyObject *valObject)
|
|||||||
|
|
||||||
if (flags & SOPT_BOOL)
|
if (flags & SOPT_BOOL)
|
||||||
{
|
{
|
||||||
if (!PyBool_Check(valObject))
|
r = set_option_value_for(key, PyObject_IsTrue(valObject), NULL,
|
||||||
{
|
opt_flags, this->opt_type, this->from);
|
||||||
PyErr_SetString(PyExc_ValueError, "Object must be boolean");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = set_option_value_for(key, (valObject == Py_True), NULL, opt_flags,
|
|
||||||
this->opt_type, this->from);
|
|
||||||
}
|
}
|
||||||
else if (flags & SOPT_NUM)
|
else if (flags & SOPT_NUM)
|
||||||
{
|
{
|
||||||
|
@@ -229,6 +229,7 @@ struct PyMethodDef { Py_ssize_t a; };
|
|||||||
# define _Py_TrueStruct (*dll__Py_TrueStruct)
|
# define _Py_TrueStruct (*dll__Py_TrueStruct)
|
||||||
# define PyObject_Init dll__PyObject_Init
|
# define PyObject_Init dll__PyObject_Init
|
||||||
# define PyObject_GetIter dll_PyObject_GetIter
|
# define PyObject_GetIter dll_PyObject_GetIter
|
||||||
|
# define PyObject_IsTrue dll_PyObject_IsTrue
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
|
||||||
# define PyType_IsSubtype dll_PyType_IsSubtype
|
# define PyType_IsSubtype dll_PyType_IsSubtype
|
||||||
# endif
|
# endif
|
||||||
@@ -324,6 +325,7 @@ static int(*dll_Py_IsInitialized)(void);
|
|||||||
static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
|
static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *);
|
||||||
static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
|
static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *);
|
||||||
static PyObject* (*dll_PyObject_GetIter)(PyObject *);
|
static PyObject* (*dll_PyObject_GetIter)(PyObject *);
|
||||||
|
static int (*dll_PyObject_IsTrue)(PyObject *);
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
||||||
static iternextfunc dll__PyObject_NextNotImplemented;
|
static iternextfunc dll__PyObject_NextNotImplemented;
|
||||||
# endif
|
# endif
|
||||||
@@ -459,6 +461,7 @@ static struct
|
|||||||
{"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
|
{"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New},
|
||||||
{"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
|
{"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init},
|
||||||
{"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
|
{"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter},
|
||||||
|
{"PyObject_IsTrue", (PYTHON_PROC*)&dll_PyObject_IsTrue},
|
||||||
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000
|
||||||
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
|
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
|
||||||
# endif
|
# endif
|
||||||
@@ -787,6 +790,9 @@ Python_Init(void)
|
|||||||
* so the following does both: unlock GIL and save thread state in TLS
|
* so the following does both: unlock GIL and save thread state in TLS
|
||||||
* without deleting thread state
|
* without deleting thread state
|
||||||
*/
|
*/
|
||||||
|
#ifndef PY_CAN_RECURSE
|
||||||
|
saved_python_thread =
|
||||||
|
#endif
|
||||||
PyEval_SaveThread();
|
PyEval_SaveThread();
|
||||||
|
|
||||||
initialised = 1;
|
initialised = 1;
|
||||||
|
@@ -156,6 +156,7 @@ static void init_structs(void);
|
|||||||
# define PyMapping_Items py3_PyMapping_Items
|
# define PyMapping_Items py3_PyMapping_Items
|
||||||
# define PyIter_Next py3_PyIter_Next
|
# define PyIter_Next py3_PyIter_Next
|
||||||
# define PyObject_GetIter py3_PyObject_GetIter
|
# define PyObject_GetIter py3_PyObject_GetIter
|
||||||
|
# define PyObject_IsTrue py3_PyObject_IsTrue
|
||||||
# define PyModule_GetDict py3_PyModule_GetDict
|
# define PyModule_GetDict py3_PyModule_GetDict
|
||||||
#undef PyRun_SimpleString
|
#undef PyRun_SimpleString
|
||||||
# define PyRun_SimpleString py3_PyRun_SimpleString
|
# define PyRun_SimpleString py3_PyRun_SimpleString
|
||||||
@@ -264,6 +265,7 @@ static PyObject* (*py3_PyLong_FromLong)(long);
|
|||||||
static PyObject* (*py3_PyDict_New)(void);
|
static PyObject* (*py3_PyDict_New)(void);
|
||||||
static PyObject* (*py3_PyIter_Next)(PyObject *);
|
static PyObject* (*py3_PyIter_Next)(PyObject *);
|
||||||
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
|
static PyObject* (*py3_PyObject_GetIter)(PyObject *);
|
||||||
|
static int (*py3_PyObject_IsTrue)(PyObject *);
|
||||||
static PyObject* (*py3_Py_BuildValue)(char *, ...);
|
static PyObject* (*py3_Py_BuildValue)(char *, ...);
|
||||||
static int (*py3_PyType_Ready)(PyTypeObject *type);
|
static int (*py3_PyType_Ready)(PyTypeObject *type);
|
||||||
static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
|
static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item);
|
||||||
@@ -392,6 +394,7 @@ static struct
|
|||||||
{"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items},
|
{"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items},
|
||||||
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
|
{"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next},
|
||||||
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
|
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
|
||||||
|
{"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue},
|
||||||
{"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
|
{"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
|
||||||
{"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
|
{"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
|
||||||
{"PyType_Ready", (PYTHON_PROC*)&py3_PyType_Ready},
|
{"PyType_Ready", (PYTHON_PROC*)&py3_PyType_Ready},
|
||||||
|
@@ -183,38 +183,21 @@ STARTTEST
|
|||||||
: $put ='[0.0, 0.0]'
|
: $put ='[0.0, 0.0]'
|
||||||
:endif
|
:endif
|
||||||
:let messages=[]
|
:let messages=[]
|
||||||
:py <<EOF
|
py <<EOF
|
||||||
d=vim.bindeval('{}')
|
d=vim.bindeval('{}')
|
||||||
m=vim.bindeval('messages')
|
m=vim.bindeval('messages')
|
||||||
|
def em(expr, g=globals(), l=locals()):
|
||||||
try:
|
try:
|
||||||
d['abc']
|
exec(expr, g, l)
|
||||||
except Exception as e:
|
except:
|
||||||
m.extend([e.__class__.__name__])
|
m.extend([sys.exc_type.__name__])
|
||||||
|
|
||||||
try:
|
em('d["abc"]')
|
||||||
d['abc']="\0"
|
em('d["abc"]="\\0"')
|
||||||
except Exception as e:
|
em('d["abc"]=vim')
|
||||||
m.extend([e.__class__.__name__])
|
em('d[""]=1')
|
||||||
|
em('d["a\\0b"]=1')
|
||||||
try:
|
em('d[u"a\\0b"]=1')
|
||||||
d['abc']=vim
|
|
||||||
except Exception as e:
|
|
||||||
m.extend([e.__class__.__name__])
|
|
||||||
|
|
||||||
try:
|
|
||||||
d['']=1
|
|
||||||
except Exception as e:
|
|
||||||
m.extend([e.__class__.__name__])
|
|
||||||
|
|
||||||
try:
|
|
||||||
d['a\0b']=1
|
|
||||||
except Exception as e:
|
|
||||||
m.extend([e.__class__.__name__])
|
|
||||||
|
|
||||||
try:
|
|
||||||
d[b'a\0b']=1
|
|
||||||
except Exception as e:
|
|
||||||
m.extend([e.__class__.__name__])
|
|
||||||
EOF
|
EOF
|
||||||
:$put =messages
|
:$put =messages
|
||||||
:unlet messages
|
:unlet messages
|
||||||
@@ -394,14 +377,14 @@ py << EOF
|
|||||||
def e(s, g=globals(), l=locals()):
|
def e(s, g=globals(), l=locals()):
|
||||||
try:
|
try:
|
||||||
exec(s, g, l)
|
exec(s, g, l)
|
||||||
except Exception as e:
|
except:
|
||||||
vim.command('throw ' + repr(e.__class__.__name__))
|
vim.command('throw ' + repr(sys.exc_type.__name__))
|
||||||
|
|
||||||
def ev(s, g=globals(), l=locals()):
|
def ev(s, g=globals(), l=locals()):
|
||||||
try:
|
try:
|
||||||
return eval(s, g, l)
|
return eval(s, g, l)
|
||||||
except Exception as e:
|
except:
|
||||||
vim.command('throw ' + repr(e.__class__.__name__))
|
vim.command('throw ' + repr(sys.exc_type.__name__))
|
||||||
return 0
|
return 0
|
||||||
EOF
|
EOF
|
||||||
:function E(s)
|
:function E(s)
|
||||||
|
@@ -82,7 +82,6 @@ def
|
|||||||
bar
|
bar
|
||||||
>>> paste
|
>>> paste
|
||||||
p/gopts1: False
|
p/gopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
p/wopts1! KeyError
|
p/wopts1! KeyError
|
||||||
inv: 2! KeyError
|
inv: 2! KeyError
|
||||||
wopts1! KeyError
|
wopts1! KeyError
|
||||||
@@ -224,7 +223,6 @@ bar
|
|||||||
wopts2! KeyError
|
wopts2! KeyError
|
||||||
wopts3! KeyError
|
wopts3! KeyError
|
||||||
p/bopts1: False
|
p/bopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
G: 0
|
G: 0
|
||||||
W: 1:0 2:1 3:0 4:1
|
W: 1:0 2:1 3:0 4:1
|
||||||
B: 1:0 2:1 3:0 4:1
|
B: 1:0 2:1 3:0 4:1
|
||||||
@@ -280,7 +278,6 @@ bar
|
|||||||
wopts2! KeyError
|
wopts2! KeyError
|
||||||
wopts3! KeyError
|
wopts3! KeyError
|
||||||
p/bopts1: False
|
p/bopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
G: 0
|
G: 0
|
||||||
W: 1:0 2:1 3:0 4:1
|
W: 1:0 2:1 3:0 4:1
|
||||||
B: 1:0 2:1 3:0 4:1
|
B: 1:0 2:1 3:0 4:1
|
||||||
|
@@ -71,7 +71,6 @@ def
|
|||||||
bar
|
bar
|
||||||
>>> paste
|
>>> paste
|
||||||
p/gopts1: False
|
p/gopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
p/wopts1! KeyError
|
p/wopts1! KeyError
|
||||||
inv: 2! KeyError
|
inv: 2! KeyError
|
||||||
wopts1! KeyError
|
wopts1! KeyError
|
||||||
@@ -213,7 +212,6 @@ bar
|
|||||||
wopts2! KeyError
|
wopts2! KeyError
|
||||||
wopts3! KeyError
|
wopts3! KeyError
|
||||||
p/bopts1: False
|
p/bopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
G: 0
|
G: 0
|
||||||
W: 1:0 2:1 3:0 4:1
|
W: 1:0 2:1 3:0 4:1
|
||||||
B: 1:0 2:1 3:0 4:1
|
B: 1:0 2:1 3:0 4:1
|
||||||
@@ -269,7 +267,6 @@ bar
|
|||||||
wopts2! KeyError
|
wopts2! KeyError
|
||||||
wopts3! KeyError
|
wopts3! KeyError
|
||||||
p/bopts1: False
|
p/bopts1: False
|
||||||
inv: 2! ValueError
|
|
||||||
G: 0
|
G: 0
|
||||||
W: 1:0 2:1 3:0 4:1
|
W: 1:0 2:1 3:0 4:1
|
||||||
B: 1:0 2:1 3:0 4:1
|
B: 1:0 2:1 3:0 4:1
|
||||||
|
@@ -728,6 +728,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
948,
|
||||||
/**/
|
/**/
|
||||||
947,
|
947,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user