diff --git a/src/PIL/ImageTk.py b/src/PIL/ImageTk.py index e51eeff6a36..16daa7ae183 100644 --- a/src/PIL/ImageTk.py +++ b/src/PIL/ImageTk.py @@ -52,6 +52,8 @@ def _pyimagingtkcall( ) -> None: tk = photo.tk ptr_str = repr(ptr).strip("<>") + # Replace pointer to actual one for pypy + ptr_str = ptr_str.rpartition("0x")[0] + hex(id(ptr)) try: tk.call(command, photo, ptr_str) except tkinter.TclError: @@ -60,6 +62,7 @@ def _pyimagingtkcall( from . import _imagingtk _imagingtk.tkinit(tk.interpaddr()) + print(">>> _pyimagingtkcall ref", ptr_str) tk.call(command, photo, ptr_str) diff --git a/src/Tk/tkImaging.c b/src/Tk/tkImaging.c index 9c0acdf0875..1b68a31c6db 100644 --- a/src/Tk/tkImaging.c +++ b/src/Tk/tkImaging.c @@ -59,6 +59,9 @@ ImagingFind(const char *name) { PyObject *capsule; const char *expected = "capsule object \"" IMAGING_MAGIC "\" at 0x"; + printf(">>> ImagingFind '%s'", name); + printf(">>> expected '%s'", expected); + if (strncmp(name, expected, strlen(expected))) { return NULL; }