summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-09-14 06:40:27 (GMT)
committerNed Deily <nad@acm.org>2014-09-14 06:40:27 (GMT)
commit2ebdb2c91157e11d70eb3178f0308f8b5bc48806 (patch)
tree03eeaad88b5b9f07ff3d671e51e680312c15cbb5
parent50ff85812f2c0eb488569531a8cfbb56b7f76b0c (diff)
parent152dfd1dac6b45177215486b68ac0ebda38dd507 (diff)
downloadcpython-2ebdb2c91157e11d70eb3178f0308f8b5bc48806.zip
cpython-2ebdb2c91157e11d70eb3178f0308f8b5bc48806.tar.gz
cpython-2ebdb2c91157e11d70eb3178f0308f8b5bc48806.tar.bz2
Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
-rw-r--r--Lib/turtle.py5
-rw-r--r--Misc/NEWS2
2 files changed, 5 insertions, 2 deletions
diff --git a/Lib/turtle.py b/Lib/turtle.py
index c9e88d9..f4400c9 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -997,8 +997,9 @@ class TurtleScreen(TurtleScreenBase):
# Force Turtle window to the front on OS X. This is needed because
# the Turtle window will show behind the Terminal window when you
# start the demo from the command line.
- cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '1')
- cv._rootwindow.call('wm', 'attributes', '.', '-topmost', '0')
+ rootwindow = cv.winfo_toplevel()
+ rootwindow.call('wm', 'attributes', '.', '-topmost', '1')
+ rootwindow.call('wm', 'attributes', '.', '-topmost', '0')
def clear(self):
"""Delete all drawings and all turtles from the TurtleScreen.
diff --git a/Misc/NEWS b/Misc/NEWS
index 54517b1..21b0638 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -132,6 +132,8 @@ Core and Builtins
Library
-------
+- Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
+
- Issue #21147: sqlite3 now raises an exception if the request contains a null
character instead of truncate it. Based on patch by Victor Stinner.