From: Guido van Rossum Date: Mon, 20 Sep 1999 00:39:47 +0000 (+0000) Subject: Peter Haight discovered that this code uses a mutable default for cnf X-Git-Tag: v1.6a1~911 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea7364c7cd989b78767efff2720b0e17db6eeb0b;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/lib-tk/ScrolledText.py b/Lib/lib-tk/ScrolledText.py index f1c2bb08afe5..05b728a5ab17 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 = {}