]> granicus.if.org Git - python/commitdiff
Issue #21868: Prevent turtle crash due to invalid undo buffer size.
authorRaymond Hettinger <python@rcn.com>
Mon, 21 Jul 2014 04:26:04 +0000 (21:26 -0700)
committerRaymond Hettinger <python@rcn.com>
Mon, 21 Jul 2014 04:26:04 +0000 (21:26 -0700)
Lib/lib-tk/turtle.py
Misc/ACKS
Misc/NEWS

index 6a9071594fb3800d300645bed63081888d887e40..75673a4bcb81d40113d2185b3cb5ad7d42c1e6b4 100644 (file)
@@ -2499,7 +2499,7 @@ class RawTurtle(TPen, TNavigator):
         Example (for a Turtle instance named turtle):
         >>> turtle.setundobuffer(42)
         """
-        if size is None:
+        if size is None or size <= 0:
             self.undobuffer = None
         else:
             self.undobuffer = Tbuffer(size)
index 27be9493f08cd7fdccab2345f4673ca708215ec0..2dc0e779ddbabf746336fad43f3d4449a7e95374 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -235,6 +235,7 @@ Ingrid Cheung
 Albert Chin-A-Young
 Adal Chiriliuc
 Matt Chisholm
+Lita Cho
 Anders Chrigström
 Tom Christiansen
 Renee Chu
index 9ba62e87806912320ec8a0ec6e130d48feef9bab..0181a4614ee325f60c6ea21f25ab4751d879e20c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,9 @@ Library
 - Issue #22017: Correct reference counting errror in the initialization of the
   _warnings module.
 
+- Issue #21868: Prevent turtle crash when undo buffer set to a value less
+  than one.
+
 - Issue #21044: tarfile.open() now handles fileobj with an integer 'name'
   attribute.  Based on patch by Martin Panter.