From: Benjamin Peterson Date: Sun, 8 Jun 2014 00:47:41 +0000 (-0700) Subject: document TokenError and unclosed expression behavior (closes #12063) X-Git-Tag: v3.4.2rc1~421 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96e0430dfb36c5fa336684601bf271b0ce43e367;p=python document TokenError and unclosed expression behavior (closes #12063) Patch by Amandine Lee. --- diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 37d9f41cc1..bd6b121f8d 100644 --- a/Doc/library/tokenize.rst +++ b/Doc/library/tokenize.rst @@ -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: diff --git a/Misc/ACKS b/Misc/ACKS index 344a29b10e..5f1a1dd8ab 100644 --- 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