|
| 1 | +--- python/modules/IcePy/Operation.cpp.orig 2017-01-29 22:23:51.186130998 +0100 |
| 2 | ++++ python/modules/IcePy/Operation.cpp 2017-01-29 22:24:55.929130998 +0100 |
| 3 | +@@ -1682,11 +1682,11 @@ |
| 4 | + } |
| 5 | + else |
| 6 | + { |
| 7 | +- if(PyTuple_SET_ITEM(results.get(), info->pos, Unset) < 0) |
| 8 | ++ if(PyTuple_SetItem(results.get(), info->pos, Unset) < 0) |
| 9 | + { |
| 10 | + return 0; |
| 11 | + } |
| 12 | +- Py_INCREF(Unset); // PyTuple_SET_ITEM steals a reference. |
| 13 | ++ Py_INCREF(Unset); // PyTuple_SetItem steals a reference. |
| 14 | + } |
| 15 | + } |
| 16 | + |
| 17 | +@@ -2546,7 +2546,7 @@ |
| 18 | + throwPythonException(); |
| 19 | + } |
| 20 | + |
| 21 | +- if(PyTuple_SET_ITEM(result.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 22 | ++ if(PyTuple_SetItem(result.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 23 | + { |
| 24 | + throwPythonException(); |
| 25 | + } |
| 26 | +@@ -2586,11 +2586,11 @@ |
| 27 | + } |
| 28 | + #endif |
| 29 | + |
| 30 | +- if(PyTuple_SET_ITEM(result.get(), 1, op.get()) < 0) |
| 31 | ++ if(PyTuple_SetItem(result.get(), 1, op.get()) < 0) |
| 32 | + { |
| 33 | + throwPythonException(); |
| 34 | + } |
| 35 | +- op.release(); // PyTuple_SET_ITEM steals a reference. |
| 36 | ++ op.release(); // PyTuple_SetItem steals a reference. |
| 37 | + |
| 38 | + return result.release(); |
| 39 | + } |
| 40 | +@@ -2827,7 +2827,7 @@ |
| 41 | + return 0; |
| 42 | + } |
| 43 | + |
| 44 | +- if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 45 | ++ if(PyTuple_SetItem(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 46 | + { |
| 47 | + return 0; |
| 48 | + } |
| 49 | +@@ -2867,11 +2867,11 @@ |
| 50 | + memcpy(buf, results.first, sz); |
| 51 | + #endif |
| 52 | + |
| 53 | +- if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0) |
| 54 | ++ if(PyTuple_SetItem(args.get(), 1, op.get()) < 0) |
| 55 | + { |
| 56 | + return 0; |
| 57 | + } |
| 58 | +- op.release(); // PyTuple_SET_ITEM steals a reference. |
| 59 | ++ op.release(); // PyTuple_SetItem steals a reference. |
| 60 | + |
| 61 | + return args.release(); |
| 62 | + } |
| 63 | +@@ -2910,7 +2910,7 @@ |
| 64 | + return; |
| 65 | + } |
| 66 | + |
| 67 | +- if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 68 | ++ if(PyTuple_SetItem(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 69 | + { |
| 70 | + assert(PyErr_Occurred()); |
| 71 | + PyErr_Print(); |
| 72 | +@@ -2958,13 +2958,13 @@ |
| 73 | + memcpy(buf, results.first, sz); |
| 74 | + #endif |
| 75 | + |
| 76 | +- if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0) |
| 77 | ++ if(PyTuple_SetItem(args.get(), 1, op.get()) < 0) |
| 78 | + { |
| 79 | + assert(PyErr_Occurred()); |
| 80 | + PyErr_Print(); |
| 81 | + return; |
| 82 | + } |
| 83 | +- op.release(); // PyTuple_SET_ITEM steals a reference. |
| 84 | ++ op.release(); // PyTuple_SetItem steals a reference. |
| 85 | + |
| 86 | + PyObjectHandle tmp = PyObject_Call(_response, args.get(), 0); |
| 87 | + if(PyErr_Occurred()) |
| 88 | +@@ -3126,7 +3126,7 @@ |
| 89 | + return; |
| 90 | + } |
| 91 | + |
| 92 | +- if(PyTuple_SET_ITEM(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 93 | ++ if(PyTuple_SetItem(args.get(), 0, ok ? incTrue() : incFalse()) < 0) |
| 94 | + { |
| 95 | + assert(PyErr_Occurred()); |
| 96 | + PyErr_Print(); |
| 97 | +@@ -3174,13 +3174,13 @@ |
| 98 | + memcpy(buf, results.first, sz); |
| 99 | + #endif |
| 100 | + |
| 101 | +- if(PyTuple_SET_ITEM(args.get(), 1, op.get()) < 0) |
| 102 | ++ if(PyTuple_SetItem(args.get(), 1, op.get()) < 0) |
| 103 | + { |
| 104 | + assert(PyErr_Occurred()); |
| 105 | + PyErr_Print(); |
| 106 | + return; |
| 107 | + } |
| 108 | +- op.release(); // PyTuple_SET_ITEM steals a reference. |
| 109 | ++ op.release(); // PyTuple_SetItem steals a reference. |
| 110 | + |
| 111 | + const string methodName = "ice_response"; |
| 112 | + if(!PyObject_HasAttrString(_callback, STRCAST(methodName.c_str()))) |
| 113 | +@@ -3302,11 +3302,11 @@ |
| 114 | + } |
| 115 | + else |
| 116 | + { |
| 117 | +- if(PyTuple_SET_ITEM(args.get(), info->pos + offset, Unset) < 0) |
| 118 | ++ if(PyTuple_SetItem(args.get(), info->pos + offset, Unset) < 0) |
| 119 | + { |
| 120 | + throwPythonException(); |
| 121 | + } |
| 122 | +- Py_INCREF(Unset); // PyTuple_SET_ITEM steals a reference. |
| 123 | ++ Py_INCREF(Unset); // PyTuple_SetItem steals a reference. |
| 124 | + } |
| 125 | + } |
| 126 | + |
| 127 | +@@ -3329,11 +3329,11 @@ |
| 128 | + // Create an object to represent Ice::Current. We need to append this to the argument tuple. |
| 129 | + // |
| 130 | + PyObjectHandle curr = createCurrent(current); |
| 131 | +- if(PyTuple_SET_ITEM(args.get(), PyTuple_GET_SIZE(args.get()) - 1, curr.get()) < 0) |
| 132 | ++ if(PyTuple_SetItem(args.get(), PyTuple_GET_SIZE(args.get()) - 1, curr.get()) < 0) |
| 133 | + { |
| 134 | + throwPythonException(); |
| 135 | + } |
| 136 | +- curr.release(); // PyTuple_SET_ITEM steals a reference. |
| 137 | ++ curr.release(); // PyTuple_SetItem steals a reference. |
| 138 | + |
| 139 | + if(_op->amd) |
| 140 | + { |
| 141 | +@@ -3347,7 +3347,7 @@ |
| 142 | + } |
| 143 | + obj->upcall = new UpcallPtr(this); |
| 144 | + obj->encoding = current.encoding; |
| 145 | +- if(PyTuple_SET_ITEM(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SET_ITEM steals a reference. |
| 146 | ++ if(PyTuple_SetItem(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SetItem steals a reference. |
| 147 | + { |
| 148 | + Py_DECREF(obj); |
| 149 | + throwPythonException(); |
| 150 | +@@ -3698,23 +3698,23 @@ |
| 151 | + } |
| 152 | + #endif |
| 153 | + |
| 154 | +- if(PyTuple_SET_ITEM(args.get(), start, ip.get()) < 0) |
| 155 | ++ if(PyTuple_SetItem(args.get(), start, ip.get()) < 0) |
| 156 | + { |
| 157 | + throwPythonException(); |
| 158 | + } |
| 159 | + ++start; |
| 160 | +- ip.release(); // PyTuple_SET_ITEM steals a reference. |
| 161 | ++ ip.release(); // PyTuple_SetItem steals a reference. |
| 162 | + |
| 163 | + // |
| 164 | + // Create an object to represent Ice::Current. We need to append |
| 165 | + // this to the argument tuple. |
| 166 | + // |
| 167 | + PyObjectHandle curr = createCurrent(current); |
| 168 | +- if(PyTuple_SET_ITEM(args.get(), start, curr.get()) < 0) |
| 169 | ++ if(PyTuple_SetItem(args.get(), start, curr.get()) < 0) |
| 170 | + { |
| 171 | + throwPythonException(); |
| 172 | + } |
| 173 | +- curr.release(); // PyTuple_SET_ITEM steals a reference. |
| 174 | ++ curr.release(); // PyTuple_SetItem steals a reference. |
| 175 | + |
| 176 | + string dispatchName = "ice_invoke"; |
| 177 | + if(_amd) |
| 178 | +@@ -3730,7 +3730,7 @@ |
| 179 | + } |
| 180 | + obj->upcall = new UpcallPtr(this); |
| 181 | + obj->encoding = current.encoding; |
| 182 | +- if(PyTuple_SET_ITEM(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SET_ITEM steals a reference. |
| 183 | ++ if(PyTuple_SetItem(args.get(), 0, (PyObject*)obj) < 0) // PyTuple_SetItem steals a reference. |
| 184 | + { |
| 185 | + Py_DECREF(obj); |
| 186 | + throwPythonException(); |
0 commit comments