subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pet...@apache.org
Subject svn commit: r1351117 - /subversion/trunk/subversion/bindings/swig/core.i
Date Sun, 17 Jun 2012 16:05:16 GMT
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");



Mime
View raw message