Skip to content

Commit a91559b

Browse files
committed
Use correct type for Tk addresses.
CPython has used a long for this address since before 2010 (it is difficult to read the merge from SVN back then), and has been a long-from-void* since 2013 (3.3.3 and 2.7.6). Fixes #7633.
1 parent f7c97f0 commit a91559b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/_tkagg.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ static PyObject *_tkinit(PyObject *self, PyObject *args)
188188
Tcl_Interp *interp;
189189
TkappObject *app;
190190

191-
Py_ssize_t arg;
191+
PyObject *arg;
192192
int is_interp;
193-
if (!PyArg_ParseTuple(args, "ni", &arg, &is_interp)) {
193+
if (!PyArg_ParseTuple(args, "Oi", &arg, &is_interp)) {
194194
return NULL;
195195
}
196196

197197
if (is_interp) {
198-
interp = (Tcl_Interp *)arg;
198+
interp = (Tcl_Interp *)PyLong_AsVoidPtr(arg);
199199
} else {
200200
/* Do it the hard way. This will break if the TkappObject
201201
layout changes */
202-
app = (TkappObject *)arg;
202+
app = (TkappObject *)PyLong_AsVoidPtr(arg);
203203
interp = app->interp;
204204
}
205205

0 commit comments

Comments
 (0)