diff options
author | Ned Deily <nad@acm.org> | 2014-09-14 06:39:16 (GMT) |
---|---|---|
committer | Ned Deily <nad@acm.org> | 2014-09-14 06:39:16 (GMT) |
commit | 152dfd1dac6b45177215486b68ac0ebda38dd507 (patch) | |
tree | 426d18058d46f9e9d6ad947c09cbbae178ffce88 /Lib/turtle.py | |
parent | 7c8b89e156a0d50a115946c63fd7226f2a9ef508 (diff) | |
download | cpython-152dfd1dac6b45177215486b68ac0ebda38dd507.zip cpython-152dfd1dac6b45177215486b68ac0ebda38dd507.tar.gz cpython-152dfd1dac6b45177215486b68ac0ebda38dd507.tar.bz2 |
Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.
Diffstat (limited to 'Lib/turtle.py')
-rw-r--r-- | Lib/turtle.py | 5 |
1 files changed, 3 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. |