From d5e3a09c449b87d6a56ca64981d2734d7c363814 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Tue, 16 Dec 2014 02:03:05 +0100 Subject: [PATCH] Python 2 compatibility with the new tokens. --- jedi/parser/token.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jedi/parser/token.py b/jedi/parser/token.py index 0c378a0d..e9ab3a62 100644 --- a/jedi/parser/token.py +++ b/jedi/parser/token.py @@ -16,6 +16,14 @@ if is_py3: BACKQUOTE = N_TOKENS tok_name[BACKQUOTE] = 'BACKQUOTE' N_TOKENS += 1 +else: + RARROW = N_TOKENS + tok_name[RARROW] = 'RARROW' + N_TOKENS += 1 + ELLIPSIS = N_TOKENS + tok_name[ELLIPSIS] = 'ELLIPSIS' + N_TOKENS += 1 + # Map from operator to number (since tokenize doesn't do this) @@ -73,6 +81,4 @@ opmap_raw = """\ opmap = {} for line in opmap_raw.splitlines(): op, name = line.split() - if is_py3 and name == 'BACKQUOTE': - continue opmap[op] = globals()[name]