Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use repr() in ImageTk #148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/PIL/ImageTk.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ def _pyimagingtkcall(
) -> None:
tk = photo.tk
try:
tk.call(command, photo, repr(ptr))
tk.call(command, photo, ptr)
except tkinter.TclError:
# activate Tkinter hook
# may raise an error if it cannot attach to Tkinter
from . import _imagingtk

_imagingtk.tkinit(tk.interpaddr())
tk.call(command, photo, repr(ptr))
tk.call(command, photo, ptr)


# --------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions src/Tk/tkImaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ ImagingFind(const char *name) {
const char *expected = "capsule object \"" IMAGING_MAGIC "\" at 0x";

if (name[0] == '<') {
// Unless PyPy is in use, the PyCapsule is converted to a string representation
name++;
} else {
// Special case for PyPy, where the string representation of a Capsule
// refers directly to the pointer itself, not to the PyCapsule object.
direct_pointer = 1;
}

Expand Down
Loading