You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pe...@apache.org on 2012/06/17 18:05:16 UTC

svn commit: r1351117 - /subversion/trunk/subversion/bindings/swig/core.i

Author: peters
Date: Sun Jun 17 16:05:16 2012
New Revision: 1351117

URL: http://svn.apache.org/viewvc?rev=1351117&view=rev
Log:
* subversion/bindings/swig/core.i
  (python typemap: char *buffer, apr_size_t *len): Accept either a
   PyInt or a PyLong buffer length argument.  swig 2.0.5+ handles this
   differently to previous releases.

Modified:
    subversion/trunk/subversion/bindings/swig/core.i

Modified: subversion/trunk/subversion/bindings/swig/core.i
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/core.i?rev=1351117&r1=1351116&r2=1351117&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/core.i (original)
+++ subversion/trunk/subversion/bindings/swig/core.i Sun Jun 17 16:05:16 2012
@@ -351,12 +351,17 @@
 */
 #ifdef SWIGPYTHON
 %typemap(in) (char *buffer, apr_size_t *len) ($*2_type temp) {
-    if (!PyInt_Check($input)) {
+    if (PyLong_Check($input)) {
+        temp = PyLong_AsLong($input);
+    }
+    else if (PyInt_Check($input)) {
+        temp = PyInt_AsLong($input);
+    }
+    else {
         PyErr_SetString(PyExc_TypeError,
                         "expecting an integer for the buffer size");
         SWIG_fail;
     }
-    temp = PyInt_AsLong($input);
     if (temp < 0) {
         PyErr_SetString(PyExc_ValueError,
                         "buffer size must be a positive integer");