]> 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 37d9f41cc1b20724d66ca79f716f75682e211d84..bd6b121f8dad5ad676c3105a18b29908d1dc8860 100644 (file)
@@ -131,6 +131,24 @@ function it uses to do this is available:
 
    .. versionadded:: 3.2
 
+.. 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.
+
 
 .. _tokenize-cli:
 
index 344a29b10e20b9c63d9e4c07658119fc6b0702ee..5f1a1dd8ab17b8c8e484a06de641b2d283db98e0 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -749,6 +749,7 @@ Julia Lawall
 Chris Lawrence
 Brian Leair
 Mathieu Leduc-Hamel
+Amandine Lee
 Antony Lee
 Christopher Lee
 Inyeol Lee