forked from VimPlug/jedi
fix python 3 issues with the new interpreter implementation
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import inspect
|
import inspect
|
||||||
|
import re
|
||||||
|
|
||||||
from jedi._compatibility import builtins
|
from jedi._compatibility import builtins
|
||||||
from jedi import debug
|
from jedi import debug
|
||||||
@@ -63,9 +64,10 @@ class LazyName(helpers.FakeName):
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if path.endswith('.pyc'):
|
path = re.sub('c$', '', path)
|
||||||
|
if path.endswith('.py'):
|
||||||
# cut the `c` from `.pyc`
|
# cut the `c` from `.pyc`
|
||||||
with open(path[:-1]) as f:
|
with open(path) as f:
|
||||||
mod = FastParser(f.read(), path[:-1]).module
|
mod = FastParser(f.read(), path[:-1]).module
|
||||||
if not parser_path:
|
if not parser_path:
|
||||||
return mod
|
return mod
|
||||||
|
|||||||
Reference in New Issue
Block a user