summaryrefslogtreecommitdiffstats
path: root/Lib/turtle.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-07-21 04:30:32 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-07-21 04:30:32 (GMT)
commit854e76effaa272feed874c0e828ee679a3949dc2 (patch)
tree6cedd74c082f229db0b45c51c14ab6c1d6193b6b /Lib/turtle.py
parent01963e6ae977ade7802d5ef67a94055e82763a44 (diff)
downloadcpython-854e76effaa272feed874c0e828ee679a3949dc2.zip
cpython-854e76effaa272feed874c0e828ee679a3949dc2.tar.gz
cpython-854e76effaa272feed874c0e828ee679a3949dc2.tar.bz2
Issue #21868: Prevent turtle crash due to invalid undo buffer size.
Diffstat (limited to 'Lib/turtle.py')
-rw-r--r--Lib/turtle.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/turtle.py b/Lib/turtle.py
index 465d6e0..c9e88d9 100644
--- a/Lib/turtle.py
+++ b/Lib/turtle.py
@@ -2594,7 +2594,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)