diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-06-27 01:02:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-27 01:02:02 -0700 |
commit | e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2 (patch) | |
tree | 85bdbab452409679eb5dec48bb0c668447909279 /Lib/tkinter/__init__.py | |
parent | 3df23b5199a4bb237a595cadca6c49d34ab2a56c (diff) | |
download | cpython-git-e1f3bd2bb50a76ba15a2f8d561e2c9968ae3a1b2.tar.gz |
bpo-44404: tkinter `after` support callable classes (GH-26812)
(cherry picked from commit e9c8f784fa13ea3a51df3b72a498a3896ec9e768)
Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
Diffstat (limited to 'Lib/tkinter/__init__.py')
-rw-r--r-- | Lib/tkinter/__init__.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py index 369004c9d1..2513c972bc 100644 --- a/Lib/tkinter/__init__.py +++ b/Lib/tkinter/__init__.py @@ -841,7 +841,11 @@ class Misc: self.deletecommand(name) except TclError: pass - callit.__name__ = func.__name__ + try: + callit.__name__ = func.__name__ + except AttributeError: + # Required for callable classes (bpo-44404) + callit.__name__ = type(func).__name__ name = self._register(callit) return self.tk.call('after', ms, name) |