1
0
forked from VimPlug/jedi

Python 2 compatibility in fake module.

This commit is contained in:
Dave Halter
2014-12-16 02:07:20 +01:00
parent d5e3a09c44
commit e53e211325
2 changed files with 2 additions and 4 deletions

View File

@@ -38,9 +38,9 @@ def _load_faked_module(module):
# There are two implementations of `open` for either python 2/3.
# -> Rename the python2 version (`look at fake/builtins.pym`).
open_func = search_scope(module, 'open')
open_func.name = FakeName('open_python3')
open_func.children[1] = FakeName('open_python3')
open_func = search_scope(module, 'open_python2')
open_func.name = FakeName('open')
open_func.children[1] = FakeName('open')
return module

View File

@@ -16,9 +16,7 @@ import re
from io import StringIO
from token import (tok_name, N_TOKENS, ENDMARKER, STRING, NUMBER, NAME, OP,
ERRORTOKEN, NEWLINE, INDENT, DEDENT)
import token
from jedi._compatibility import is_py3
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")