summaryrefslogtreecommitdiff
path: root/doc/_extensions
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2018-10-23 10:39:22 +0000
committerXavier Morel <xmo@odoo.com>2018-10-23 10:39:22 +0000
commit35bb8304ab99bde2623b9b64b80728d31fbee14f (patch)
tree6fa810fa85885d809d1a5b1578362e1b082aba40 /doc/_extensions
parenteef4c3b48bcb4feac028bf640b545006dd0c9b91 (diff)
[FIX] doc: building on Python 3.6.7, 3.7.1, possibly 2.7.???
https://bugs.python.org/issue33899 tokenize.generate_tokens was altered to match the C tokenizer, previously it would end the tokenization with just an ENDMARKER, in the titled releases it adds a NEWLINE before the ENDMARKER if none is present, this broke the parsing of jsdoc type specifications as Python's tokenizer is used under the cover. closes odoo/odoo#28056
Diffstat (limited to 'doc/_extensions')
-rw-r--r--doc/_extensions/autojsdoc/parser/types.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/_extensions/autojsdoc/parser/types.py b/doc/_extensions/autojsdoc/parser/types.py
index 8737b26ecc9..69836f46ac4 100644
--- a/doc/_extensions/autojsdoc/parser/types.py
+++ b/doc/_extensions/autojsdoc/parser/types.py
@@ -44,6 +44,8 @@ def tokenize(typespec):
yield (LITERAL, ast.literal_eval(string))
elif toktype == token.ENDMARKER:
return
+ elif toktype == token.NEWLINE:
+ pass
else:
raise ValueError("Unknown typespec token %s" % token.tok_name[toktype])