diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-10-09 22:05:45 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-10-09 22:05:45 (GMT) |
commit | de0559998fef231efc9ecbdef5b3a195d4eaa28d (patch) | |
tree | 235b05866ae52f80d81f2953c663d74f1de6dae1 /Lib/lib-tk | |
parent | 0c8bee639368324b750176ee171cadd33847f18e (diff) | |
download | cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.zip cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.tar.gz cpython-de0559998fef231efc9ecbdef5b3a195d4eaa28d.tar.bz2 |
replace callable()
Diffstat (limited to 'Lib/lib-tk')
-rwxr-xr-x | Lib/lib-tk/Tix.py | 2 | ||||
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py index 2616252..f1a1091 100755 --- a/Lib/lib-tk/Tix.py +++ b/Lib/lib-tk/Tix.py @@ -405,7 +405,7 @@ class TixWidget(Tkinter.Widget): elif kw: cnf = kw options = () for k, v in cnf.items(): - if callable(v): + if hasattr(v, '__call__'): v = self._register(v) options = options + ('-'+k, v) return master.tk.call(('image', 'create', imgtype,) + options) diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index 46b2781..4dcb256 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -1047,7 +1047,7 @@ class Misc: for k, v in cnf.items(): if v is not None: if k[-1] == '_': k = k[:-1] - if callable(v): + if hasattr(v, '__call__'): v = self._register(v) elif isinstance(v, (tuple, list)): nv = [] @@ -3194,7 +3194,7 @@ class Image: elif kw: cnf = kw options = () for k, v in cnf.items(): - if callable(v): + if hasattr(v, '__call__'): v = self._register(v) options = options + ('-'+k, v) self.tk.call(('image', 'create', imgtype, name,) + options) @@ -3217,7 +3217,7 @@ class Image: for k, v in _cnfmerge(kw).items(): if v is not None: if k[-1] == '_': k = k[:-1] - if callable(v): + if hasattr(v, '__call__'): v = self._register(v) res = res + ('-'+k, v) self.tk.call((self.name, 'config') + res) |