mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 06:24:27 +08:00
python 2.5 compatibility, works, but tests fail, because certain thing don't exist in 2.5 (like int.real)
This commit is contained in:
11
parsing.py
11
parsing.py
@@ -31,10 +31,9 @@ Ignored statements:
|
||||
TODO take special care for future imports
|
||||
TODO check meta classes
|
||||
"""
|
||||
from _compatibility import next, literal_eval
|
||||
from _compatibility import next, literal_eval, tokenize_func, BytesIO
|
||||
|
||||
import tokenize
|
||||
from io import BytesIO
|
||||
import re
|
||||
|
||||
import debug
|
||||
@@ -1246,13 +1245,7 @@ class PyFuzzyParser(object):
|
||||
:raises: IndentationError
|
||||
"""
|
||||
buf = BytesIO(self.code.encode())
|
||||
#print(self.code.encode())
|
||||
#print(list(tokenize.tokenize(BytesIO(self.code.encode()).readline))[:9])
|
||||
import sys
|
||||
if sys.hexversion > 0x03000000:
|
||||
self.gen = tokenize.tokenize(buf.readline)
|
||||
else:
|
||||
self.gen = tokenize.generate_tokens(buf.readline)
|
||||
self.gen = tokenize_func(buf.readline)
|
||||
self.currentscope = self.scope
|
||||
|
||||
extended_flow = ['else', 'elif', 'except', 'finally']
|
||||
|
||||
Reference in New Issue
Block a user