summaryrefslogtreecommitdiff
path: root/Lib/turtle.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-09-13 23:39:16 -0700
committerNed Deily <nad@acm.org>2014-09-13 23:39:16 -0700
commit0d48f974662035c14912d225b71b6cf93b621bb0 (patch)
tree6470630804e2fb2836ab2991a9f8c01f68fcccff /Lib/turtle.py
parent76b535066e42ee3d95502dd99ebbc6a05e7fdd87 (diff)
downloadcpython-0d48f974662035c14912d225b71b6cf93b621bb0.tar.gz
Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
Diffstat (limited to 'Lib/turtle.py')
-rw-r--r--Lib/turtle.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/turtle.py b/Lib/turtle.py
index c9e88d9dd1..f4400c90fd 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.