]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Peter Haight discovered that this code uses a mutable default for cnf
authorGuido van Rossum <guido@python.org>
Mon, 20 Sep 1999 00:39:47 +0000 (00:39 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 20 Sep 1999 00:39:47 +0000 (00:39 +0000)
and then (under certain circumstances) can clobber the default!
He also submitted this patch as PR#82.

Lib/lib-tk/ScrolledText.py

index f1c2bb08afe5739a1143dd4ff7b56745bd87212a..05b728a5ab17012576321e7829971e362613e0fc 100644 (file)
@@ -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 = {}