[Python-checkins] gh-91212: Fixed flickering when the tracer is turned off (GH-95129)

miss-islington webhook-mailer at python.org
Thu Sep 29 03:07:18 EDT 2022


https://github.com/python/cpython/commit/9cf41f4a7a85b573cf68c248cbf2236fadbf44ef
commit: 9cf41f4a7a85b573cf68c248cbf2236fadbf44ef
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-09-29T00:07:07-07:00
summary:

gh-91212: Fixed flickering when the tracer is turned off (GH-95129)


Fixed flickering when the tracer is turned off.
(cherry picked from commit 4652093e1b816b78e9a585d671a807ce66427417)

Co-authored-by: Shin-myoung-serp <relent95 at naver.com>

files:
A Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst
M Lib/turtle.py
M Lib/turtledemo/clock.py

diff --git a/Lib/turtle.py b/Lib/turtle.py
index a8876e76bce4..6abf9f7f65af 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -596,7 +596,6 @@ def _write(self, pos, txt, align, font, pencolor):
         item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align],
                                         fill = pencolor, font = font)
         x0, y0, x1, y1 = self.cv.bbox(item)
-        self.cv.update()
         return item, x1-1
 
 ##    def _dot(self, pos, size, color):
@@ -3419,6 +3418,7 @@ def _write(self, txt, align, font):
         """
         item, end = self.screen._write(self._position, txt, align, font,
                                                           self._pencolor)
+        self._update()
         self.items.append(item)
         if self.undobuffer:
             self.undobuffer.push(("wri", item))
diff --git a/Lib/turtledemo/clock.py b/Lib/turtledemo/clock.py
index 62c8851606b3..9f8585bd11e0 100755
--- a/Lib/turtledemo/clock.py
+++ b/Lib/turtledemo/clock.py
@@ -109,7 +109,6 @@ def tick():
         writer.write(datum(t),
                      align="center", font=("Courier", 14, "bold"))
         writer.forward(85)
-        tracer(True)
         second_hand.setheading(6*sekunde)  # or here
         minute_hand.setheading(6*minute)
         hour_hand.setheading(30*stunde)
diff --git a/Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst b/Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst
new file mode 100644
index 000000000000..8552f51196b5
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-07-22-09-09-08.gh-issue-91212.53O8Ab.rst
@@ -0,0 +1 @@
+Fixed flickering of the turtle window when the tracer is turned off. Patch by Shin-myoung-serp.



More information about the Python-checkins mailing list