From 2b91fadc7f631248d5801ddfb2713d434fc3ea8b Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sun, 25 Sep 2016 16:44:32 +0300 Subject: [PATCH] Issue #27611: Fixed support of default root window in the Tix module. --- Lib/lib-tk/Tix.py | 12 ++++++++---- Misc/NEWS | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Lib/lib-tk/Tix.py b/Lib/lib-tk/Tix.py index 50938ccc42..a7b785e49a 100644 --- a/Lib/lib-tk/Tix.py +++ b/Lib/lib-tk/Tix.py @@ -477,10 +477,14 @@ class DisplayStyle: (multiple) Display Items""" def __init__(self, itemtype, cnf={}, **kw): - master = Tkinter._default_root - if not master and 'refwindow' in cnf: master=cnf['refwindow'] - elif not master and 'refwindow' in kw: master= kw['refwindow'] - elif not master: raise RuntimeError, "Too early to create display style: no root window" + if 'refwindow' in kw: + master = kw['refwindow'] + elif 'refwindow' in cnf: + master = cnf['refwindow'] + else: + master = Tkinter._default_root + if not master: + raise RuntimeError("Too early to create display style: no root window") self.tk = master.tk self.stylename = self.tk.call('tixDisplayStyle', itemtype, *self._options(cnf,kw) ) diff --git a/Misc/NEWS b/Misc/NEWS index 4fa9f7cf66..2fcf554774 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -42,6 +42,8 @@ Core and Builtins Library ------- +- Issue #27611: Fixed support of default root window in the Tix module. + - Issue #24363: When parsing HTTP header fields, if an invalid line is encountered, skip it and continue parsing. Previously, no more header fields were parsed, which could lead to fields for HTTP framing like -- 2.50.1