splitlines and source_to_unicode are utils of parso.

This commit is contained in:
Dave Halter
2017-05-20 09:55:16 -04:00
parent 0f4b7db56a
commit 50c7137437
9 changed files with 27 additions and 118 deletions
+6 -4
View File
@@ -16,14 +16,16 @@ import os
import pkgutil
import sys
from jedi._compatibility import find_module, unicode, ImplicitNSInfo
from jedi import debug
from jedi import settings
from jedi.common import source_to_unicode, unite
from parso.python import parse
from parso.python import tree
from parso.tree import search_ancestor
from parso.cache import parser_cache
from parso.utils import source_to_unicode
from jedi._compatibility import find_module, unicode, ImplicitNSInfo
from jedi import debug
from jedi import settings
from jedi.common import unite
from jedi.evaluate import sys_path
from jedi.evaluate import helpers
from jedi.evaluate import compiled
+4 -3
View File
@@ -43,10 +43,11 @@ import imp
import re
from itertools import chain
from jedi._compatibility import use_metaclass
from parso.python import tree
from parso.utils import source_to_unicode
from jedi._compatibility import use_metaclass
from jedi import debug
from jedi import common
from jedi.evaluate.cache import memoize_default, CachedMetaClass, NO_DEFAULT
from jedi.evaluate import compiled
from jedi.evaluate import recursion
@@ -546,7 +547,7 @@ class ModuleContext(use_metaclass(CachedMetaClass, context.TreeContext)):
init_path = self.py__file__()
if os.path.basename(init_path) == '__init__.py':
with open(init_path, 'rb') as f:
content = common.source_to_unicode(f.read())
content = source_to_unicode(f.read())
# these are strings that need to be used for namespace packages,
# the first one is ``pkgutil``, the second ``pkg_resources``.
options = ('declare_namespace(__name__)', 'extend_path(__path__')