forked from VimPlug/jedi
py3k/py2.5 compatibility, and a bugfix
This commit is contained in:
@@ -167,3 +167,8 @@ if is_py25:
|
|||||||
yield element
|
yield element
|
||||||
itertools.chain = chain
|
itertools.chain = chain
|
||||||
del chain
|
del chain
|
||||||
|
|
||||||
|
try:
|
||||||
|
from functools import reduce
|
||||||
|
except ImportError:
|
||||||
|
reduce = reduce
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import re
|
import re
|
||||||
import operator
|
import operator
|
||||||
from functools import reduce
|
|
||||||
|
|
||||||
import parsing
|
import parsing
|
||||||
from _compatibility import use_metaclass
|
from _compatibility import use_metaclass, reduce, property
|
||||||
|
|
||||||
parser_cache = {}
|
parser_cache = {}
|
||||||
|
|
||||||
@@ -57,7 +56,7 @@ class Module(parsing.Simple, parsing.Module):
|
|||||||
key = 'get_statement_for_position', pos
|
key = 'get_statement_for_position', pos
|
||||||
if key not in self.cache:
|
if key not in self.cache:
|
||||||
for p in self.parsers:
|
for p in self.parsers:
|
||||||
s = p.module.get_statement_for_position(self)
|
s = p.module.get_statement_for_position(pos)
|
||||||
if s:
|
if s:
|
||||||
self.cache[key] = s
|
self.cache[key] = s
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user