]> granicus.if.org Git - python/commitdiff
document TokenError and unclosed expression behavior (closes #12063)
authorBenjamin Peterson <benjamin@python.org>
Sun, 8 Jun 2014 00:47:41 +0000 (17:47 -0700)
committerBenjamin Peterson <benjamin@python.org>
Sun, 8 Jun 2014 00:47:41 +0000 (17:47 -0700)
Patch by Amandine Lee.

Doc/library/tokenize.rst
Misc/ACKS

index 0fc0d7ef1b69926004edd61cabbb275602751408..3f25a2cbc0c5c73388a82df9d2ef1e7d4f020c5f 100644 (file)
@@ -98,6 +98,24 @@ back the modified script.
 
    .. versionadded:: 2.5
 
+.. exception:: TokenError
+
+   Raised when either a docstring or expression that may be split over several
+   lines is not completed anywhere in the file, for example::
+
+      """Beginning of
+      docstring
+
+   or::
+
+      [1,
+       2,
+       3
+
+Note that unclosed single-quoted strings do not cause an error to be
+raised. They are tokenized as ``ERRORTOKEN``, followed by the tokenization of
+their contents.
+
 Example of a script re-writer that transforms float literals into Decimal
 objects::
 
index f6449ba8734c7cb8a7bdc390b925cfee0b342f12..d16f1cd1650933bdffe112d61925f045a4b9e981 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -750,6 +750,7 @@ Julia Lawall
 Chris Lawrence
 Brian Leair
 Mathieu Leduc-Hamel
+Amandine Lee
 Christopher Lee
 Inyeol Lee
 James Lee