summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-08-07 14:38:55 (GMT)
committerGitHub <noreply@github.com>2023-08-07 14:38:55 (GMT)
commit50e3cc9748eb2103eb7ed6cc5a74d177df3cfb13 (patch)
tree8f1961ca698d9824dba4acf185e2dd2176ed89a8 /Lib/tkinter
parent835e38891535649321230f94121410244c583966 (diff)
downloadcpython-50e3cc9748eb2103eb7ed6cc5a74d177df3cfb13.zip
cpython-50e3cc9748eb2103eb7ed6cc5a74d177df3cfb13.tar.gz
cpython-50e3cc9748eb2103eb7ed6cc5a74d177df3cfb13.tar.bz2
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.
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/__init__.py4
1 files changed, 0 insertions, 4 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index c675c51..c59f8d1 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -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)