Commits

Benjamin Peterson committed ddc174c

document TokenError and unclosed expression behavior (closes #12063)

Patch by Amandine Lee.

  • Participants
  • Parent commits 7aa7207
  • Branches 3.4

Comments (0)

Files changed (2)

File Doc/library/tokenize.rst

 
    .. 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:
 
 Chris Lawrence
 Brian Leair
 Mathieu Leduc-Hamel
+Amandine Lee
 Antony Lee
 Christopher Lee
 Inyeol Lee