From 35bb8304ab99bde2623b9b64b80728d31fbee14f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 23 Oct 2018 10:39:22 +0000 Subject: [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 --- doc/_extensions/autojsdoc/parser/types.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/_extensions/autojsdoc') 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]) -- cgit v1.2.3