diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-06-08 00:47:41 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-06-08 00:47:41 (GMT) |
commit | 96e0430dfb36c5fa336684601bf271b0ce43e367 (patch) | |
tree | 9229145154d7aa329f52608b0cca7be30ad77dfc /Doc | |
parent | ed1160b39c23c4b035b6c203cc6df53274d08939 (diff) | |
download | cpython-96e0430dfb36c5fa336684601bf271b0ce43e367.zip cpython-96e0430dfb36c5fa336684601bf271b0ce43e367.tar.gz cpython-96e0430dfb36c5fa336684601bf271b0ce43e367.tar.bz2 |
document TokenError and unclosed expression behavior (closes #12063)
Patch by Amandine Lee.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/tokenize.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/library/tokenize.rst b/Doc/library/tokenize.rst index 37d9f41..bd6b121 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: |