@@ -183,32 +183,23 @@ static int PyAggImagePhoto(ClientData clientdata, Tcl_Interp *interp, int
183
183
return TCL_OK;
184
184
}
185
185
186
- static PyObject *_pyobj_addr (PyObject *self, PyObject *args)
187
- {
188
- PyObject *pyobj;
189
- if (!PyArg_ParseTuple (args, " O" , &pyobj)) {
190
- return NULL ;
191
- }
192
- return Py_BuildValue (" n" , (Py_ssize_t)pyobj);
193
- }
194
-
195
186
static PyObject *_tkinit (PyObject *self, PyObject *args)
196
187
{
197
188
Tcl_Interp *interp;
198
189
TkappObject *app;
199
190
200
- Py_ssize_t arg;
191
+ PyObject * arg;
201
192
int is_interp;
202
- if (!PyArg_ParseTuple (args, " ni " , &arg, &is_interp)) {
193
+ if (!PyArg_ParseTuple (args, " Oi " , &arg, &is_interp)) {
203
194
return NULL ;
204
195
}
205
196
206
197
if (is_interp) {
207
- interp = (Tcl_Interp *)arg;
198
+ interp = (Tcl_Interp *)PyLong_AsVoidPtr ( arg) ;
208
199
} else {
209
200
/* Do it the hard way. This will break if the TkappObject
210
201
layout changes */
211
- app = (TkappObject *)arg;
202
+ app = (TkappObject *)PyLong_AsVoidPtr ( arg) ;
212
203
interp = app->interp ;
213
204
}
214
205
@@ -226,7 +217,7 @@ static PyObject *_tkinit(PyObject *self, PyObject *args)
226
217
227
218
static PyMethodDef functions[] = {
228
219
/* Tkinter interface stuff */
229
- { " _pyobj_addr " , (PyCFunction)_pyobj_addr, 1 }, { " tkinit" , (PyCFunction)_tkinit, 1 },
220
+ { " tkinit" , (PyCFunction)_tkinit, 1 },
230
221
{ NULL , NULL } /* sentinel */
231
222
};
232
223
0 commit comments