From 10db853925839e04478fe9e54e50950223ad5dac Mon Sep 17 00:00:00 2001 From: Aleksandr Karpinskii Date: Mon, 2 Sep 2024 12:48:31 +0400 Subject: [PATCH] debug --- src/PIL/ImageTk.py | 3 +++ src/Tk/tkImaging.c | 3 +++ 2 files changed, 6 insertions(+) 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; }