mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
updated for version 7.3.584
Problem: PyCObject is not always defined. Solution: Use PyObject instead.
This commit is contained in:
@@ -2432,32 +2432,25 @@ typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *);
|
||||
convert_dl(PyObject *obj, typval_T *tv,
|
||||
pytotvfunc py_to_tv, PyObject *lookupDict)
|
||||
{
|
||||
# ifdef PY_USE_CAPSULE
|
||||
PyObject *capsule;
|
||||
# else
|
||||
PyCObject *cobject;
|
||||
# endif
|
||||
char hexBuf[sizeof(void *) * 2 + 3];
|
||||
|
||||
sprintf(hexBuf, "%p", obj);
|
||||
|
||||
# ifdef PY_USE_CAPSULE
|
||||
capsule = PyDict_GetItemString(lookupDict, hexBuf);
|
||||
if (capsule == NULL)
|
||||
# else
|
||||
cobject = (PyCObject *)PyDict_GetItemString(lookupDict, hexBuf);
|
||||
if (cobject == NULL)
|
||||
capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf);
|
||||
# endif
|
||||
if (capsule == NULL)
|
||||
{
|
||||
# ifdef PY_USE_CAPSULE
|
||||
capsule = PyCapsule_New(tv, NULL, NULL);
|
||||
# else
|
||||
capsule = PyCObject_FromVoidPtr(tv, NULL);
|
||||
# endif
|
||||
PyDict_SetItemString(lookupDict, hexBuf, capsule);
|
||||
Py_DECREF(capsule);
|
||||
# else
|
||||
cobject = PyCObject_FromVoidPtr(tv, NULL);
|
||||
PyDict_SetItemString(lookupDict, hexBuf, cobject);
|
||||
Py_DECREF(cobject);
|
||||
# endif
|
||||
if (py_to_tv(obj, tv, lookupDict) == -1)
|
||||
{
|
||||
tv->v_type = VAR_UNKNOWN;
|
||||
@@ -2478,7 +2471,7 @@ convert_dl(PyObject *obj, typval_T *tv,
|
||||
# ifdef PY_USE_CAPSULE
|
||||
v = PyCapsule_GetPointer(capsule, NULL);
|
||||
# else
|
||||
v = PyCObject_AsVoidPtr(cobject);
|
||||
v = PyCObject_AsVoidPtr(capsule);
|
||||
# endif
|
||||
copy_tv(v, tv);
|
||||
}
|
||||
|
Reference in New Issue
Block a user