Skip to content

Commit

Permalink
Do not use repr()
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Sep 30, 2024
1 parent b9d1768 commit 0827ac1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit 0827ac1

Please sign in to comment.