mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-100814: Fix exception for invalid callable value of Tkinter image option (GH-107692)
Passing a callable object as an option value to a Tkinter image now raises the expected TclError instead of an AttributeError.
This commit is contained in:
parent
835e388915
commit
50e3cc9748
3 changed files with 18 additions and 4 deletions
|
|
@ -4069,8 +4069,6 @@ class Image:
|
|||
elif kw: cnf = kw
|
||||
options = ()
|
||||
for k, v in cnf.items():
|
||||
if callable(v):
|
||||
v = self._register(v)
|
||||
options = options + ('-'+k, v)
|
||||
self.tk.call(('image', 'create', imgtype, name,) + options)
|
||||
self.name = name
|
||||
|
|
@ -4097,8 +4095,6 @@ class Image:
|
|||
for k, v in _cnfmerge(kw).items():
|
||||
if v is not None:
|
||||
if k[-1] == '_': k = k[:-1]
|
||||
if callable(v):
|
||||
v = self._register(v)
|
||||
res = res + ('-'+k, v)
|
||||
self.tk.call((self.name, 'config') + res)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue