https://github.com/python/cpython/commit/e39b7f2136b930ace0916145844e8eedcf3c455f
commit: e39b7f2136b930ace0916145844e8eedcf3c455f
branch: main
author: 单禹铎 <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-09-19T13:32:10+01:00
summary:

gh-136722: Document the `turtle.TurtleGraphicsError` exception (#157792)

Co-authored-by: Stan Ulbrych <[email protected]>

files:
M Doc/library/turtle.rst

diff --git a/Doc/library/turtle.rst b/Doc/library/turtle.rst
index 5dc083c12ccce2..da590bcb8de550 100644
--- a/Doc/library/turtle.rst
+++ b/Doc/library/turtle.rst
@@ -2571,6 +2571,25 @@ Public classes
    * ``a.rotate(angle)`` rotation
 
 
+Exceptions
+==========
+
+The :mod:`!turtle` module defines the following exception:
+
+.. exception:: TurtleGraphicsError
+
+   Raised for invalid arguments or operations.
+   For example, a malformed color string:
+
+   .. doctest::
+      :skipif: _tkinter is None
+
+      >>> turtle.color("blau")
+      Traceback (most recent call last):
+          ...
+      turtle.TurtleGraphicsError: bad color string: blau
+
+
 .. _turtle-explanation:
 
 Explanation

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to