diff options
author | Guido van Rossum <guido@python.org> | 1999-09-20 00:39:47 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-09-20 00:39:47 (GMT) |
commit | ea7364c7cd989b78767efff2720b0e17db6eeb0b (patch) | |
tree | 531f251f368aac247e88cdaa5427f33aa0b64d84 | |
parent | 3aca65312a9b6c5fe741167764d56de073259f73 (diff) | |
download | cpython-ea7364c7cd989b78767efff2720b0e17db6eeb0b.zip cpython-ea7364c7cd989b78767efff2720b0e17db6eeb0b.tar.gz cpython-ea7364c7cd989b78767efff2720b0e17db6eeb0b.tar.bz2 |
Peter Haight discovered that this code uses a mutable default for cnf
and then (under certain circumstances) can clobber the default!
He also submitted this patch as PR#82.
-rw-r--r-- | Lib/lib-tk/ScrolledText.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/lib-tk/ScrolledText.py b/Lib/lib-tk/ScrolledText.py index f1c2bb0..05b728a 100644 --- a/Lib/lib-tk/ScrolledText.py +++ b/Lib/lib-tk/ScrolledText.py @@ -14,7 +14,9 @@ from Tkinter import * from Tkinter import _cnfmerge class ScrolledText(Text): - def __init__(self, master=None, cnf={}, **kw): + def __init__(self, master=None, cnf=None, **kw): + if cnf is None: + cnf = {} if kw: cnf = _cnfmerge((cnf, kw)) fcnf = {} |