[Python-checkins] cpython (merge 3.4 -> default): Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.

ned.deily python-checkins at python.org
Sun Sep 14 08:41:14 CEST 2014


http://hg.python.org/cpython/rev/775453a7b85d
changeset:   92416:775453a7b85d
parent:      92414:f5cde9c5ef60
parent:      92415:fac17d06e01d
user:        Ned Deily <nad at acm.org>
date:        Sat Sep 13 23:40:27 2014 -0700
summary:
  Issue #22168: Prevent turtle AttributeError with non-default Canvas on OS X.

files:
  Lib/turtle.py |  5 +++--
  Misc/NEWS     |  2 ++
  2 files changed, 5 insertions(+), 2 deletions(-)


diff --git a/Lib/turtle.py b/Lib/turtle.py
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -997,8 +997,9 @@
             # 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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -132,6 +132,8 @@
 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.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list