Loading ...
Sorry, an error occurred while loading the content.

Patch 7.3.584

Expand Messages
  • Bram Moolenaar
    Patch 7.3.584 Problem: PyCObject is not always defined. Solution: Use PyObject instead. Files: src/if_py_both.h, src/if_python.c ... ***************
    Message 1 of 5 , Jun 30, 2012
    • 0 Attachment
      Patch 7.3.584
      Problem: PyCObject is not always defined.
      Solution: Use PyObject instead.
      Files: src/if_py_both.h, src/if_python.c


      *** ../vim-7.3.583/src/if_py_both.h 2012-06-29 17:51:58.000000000 +0200
      --- src/if_py_both.h 2012-06-30 13:25:24.000000000 +0200
      ***************
      *** 2432,2463 ****
      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)
      # endif
      {
      # ifdef PY_USE_CAPSULE
      capsule = PyCapsule_New(tv, NULL, NULL);
      - 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;
      --- 2432,2456 ----
      convert_dl(PyObject *obj, typval_T *tv,
      pytotvfunc py_to_tv, PyObject *lookupDict)
      {
      PyObject *capsule;
      char hexBuf[sizeof(void *) * 2 + 3];

      sprintf(hexBuf, "%p", obj);

      # ifdef PY_USE_CAPSULE
      capsule = PyDict_GetItemString(lookupDict, hexBuf);
      # else
      ! 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);
      if (py_to_tv(obj, tv, lookupDict) == -1)
      {
      tv->v_type = VAR_UNKNOWN;
      ***************
      *** 2478,2484 ****
      # ifdef PY_USE_CAPSULE
      v = PyCapsule_GetPointer(capsule, NULL);
      # else
      ! v = PyCObject_AsVoidPtr(cobject);
      # endif
      copy_tv(v, tv);
      }
      --- 2471,2477 ----
      # ifdef PY_USE_CAPSULE
      v = PyCapsule_GetPointer(capsule, NULL);
      # else
      ! v = PyCObject_AsVoidPtr(capsule);
      # endif
      copy_tv(v, tv);
      }
      *** ../vim-7.3.583/src/if_python.c 2012-06-30 13:21:03.000000000 +0200
      --- src/if_python.c 2012-06-30 13:23:22.000000000 +0200
      ***************
      *** 327,334 ****
      static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
      static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
      # else
      ! static PyCObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
      ! static void* (*dll_PyCObject_AsVoidPtr)(PyCObject *);
      # endif

      static HINSTANCE hinstPython = 0; /* Instance of python.dll */
      --- 327,334 ----
      static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
      static void* (*dll_PyCapsule_GetPointer)(PyObject *, char *);
      # else
      ! static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *));
      ! static void* (*dll_PyCObject_AsVoidPtr)(PyObject *);
      # endif

      static HINSTANCE hinstPython = 0; /* Instance of python.dll */
      *** ../vim-7.3.583/src/version.c 2012-06-30 13:21:03.000000000 +0200
      --- src/version.c 2012-06-30 13:33:08.000000000 +0200
      ***************
      *** 716,717 ****
      --- 716,719 ----
      { /* Add new patch number below this line */
      + /**/
      + 584,
      /**/

      --
      hundred-and-one symptoms of being an internet addict:
      91. It's Saturday afternoon in the middle of May and you
      are on computer.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Taylor Hedberg
      This patch doesn t appear to have been published in the Mercurial repo on Google Code.
      Message 2 of 5 , Jun 30, 2012
      • 0 Attachment
        This patch doesn't appear to have been published in the Mercurial repo
        on Google Code.
      • Bram Moolenaar
        ... It should be there: 2d107086903a updated for version 7.3.584 Problem: PyCObject is not always defined. Solution: Use PyObject instead. Today (7 hours ago)
        Message 3 of 5 , Jun 30, 2012
        • 0 Attachment
          Taylor Hedberg wrote:

          > This patch doesn't appear to have been published in the Mercurial repo
          > on Google Code.

          It should be there:

          2d107086903a
          updated for version 7.3.584 Problem: PyCObject is not always defined. Solution: Use PyObject instead.
          Today (7 hours ago)

          --
          From "know your smileys":
          y:-) Bad toupee

          /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
          /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
          \\\ an exciting new programming language -- http://www.Zimbu.org ///
          \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Ingo Karkat
          ... It is. And I can confirm that Python support is working again for me with Python 2.5.2 on Ubuntu 10.04/x86. Thanks, Bram! -- regards, ingo -- You received
          Message 4 of 5 , Jun 30, 2012
          • 0 Attachment
            On 30-Jun-2012 22:03:42 +0200, Bram Moolenaar wrote:

            > Taylor Hedberg wrote:
            >
            >> This patch doesn't appear to have been published in the Mercurial repo
            >> on Google Code.
            >
            > It should be there:
            >
            > 2d107086903a
            > updated for version 7.3.584 Problem: PyCObject is not always defined.
            > Solution: Use PyObject instead. Today (7 hours ago)

            It is. And I can confirm that Python support is working again for me with Python
            2.5.2 on Ubuntu 10.04/x86.

            Thanks, Bram!

            -- regards, ingo

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Taylor Hedberg
            ... Sorry for the noise, I checked again a few hours later and it was showing up for me. Meant to reply here but forgot about it. Thanks!
            Message 5 of 5 , Jul 2, 2012
            • 0 Attachment
              Bram Moolenaar, Sat 2012-06-30 @ 22:03:42+0200:
              > It should be there:
              >
              > 2d107086903a
              > updated for version 7.3.584 Problem: PyCObject is not always defined. Solution: Use PyObject instead.
              > Today (7 hours ago)

              Sorry for the noise, I checked again a few hours later and it was
              showing up for me. Meant to reply here but forgot about it.

              Thanks!
            Your message has been successfully submitted and would be delivered to recipients shortly.