~svn/ubuntu/oneiric/subversion/ppa

« back to all changes in this revision

Viewing changes to debian/patches/python-swig205

  • Committer: Max Bowsher
  • Date: 2012-10-25 00:08:47 UTC
  • mfrom: (44.1.49 precise)
  • Revision ID: _@maxb.eu-20121025000847-8xxg7ea4qdqio0w4
Tags: 1.7.7-0svn2~oneiric+svn1
MergeĀ 1.7.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Fix python bindings for swig 2.0.5.
2
 
Somehow swig 2.0.5 produces a long integer instead of an integer in this
3
 
situation - I'm not entirely clear on specifics.  But tolerate both as
4
 
inputs to svn_stream_read().
5
 
 
6
 
 
7
 
--- a/subversion/bindings/swig/core.i
8
 
+++ b/subversion/bindings/swig/core.i
9
 
@@ -350,12 +350,17 @@
10
 
 */
11
 
 #ifdef SWIGPYTHON
12
 
 %typemap(in) (char *buffer, apr_size_t *len) ($*2_type temp) {
13
 
-    if (!PyInt_Check($input)) {
14
 
+    if (PyLong_Check($input)) {
15
 
+        temp = PyLong_AsLong($input);
16
 
+    }
17
 
+    else if (PyInt_Check($input)) {
18
 
+        temp = PyInt_AsLong($input);
19
 
+    }
20
 
+    else {
21
 
         PyErr_SetString(PyExc_TypeError,
22
 
                         "expecting an integer for the buffer size");
23
 
         SWIG_fail;
24
 
     }
25
 
-    temp = PyInt_AsLong($input);
26
 
     if (temp < 0) {
27
 
         PyErr_SetString(PyExc_ValueError,
28
 
                         "buffer size must be a positive integer");