1
0
forked from VimPlug/jedi

Remove some of the last py27 errors that were caused in combination with 3.6

This commit is contained in:
Dave Halter
2017-12-29 02:45:11 +01:00
parent ec9b8e8c02
commit 35158f693d
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -273,7 +273,7 @@ class Importer(object):
This method is very similar to importlib's `_gcd_import`. This method is very similar to importlib's `_gcd_import`.
""" """
import_parts = [ import_parts = [
i.value if isinstance(i, tree.Name) else i force_unicode(i.value if isinstance(i, tree.Name) else i)
for i in import_path for i in import_path
] ]
+4 -4
View File
@@ -25,6 +25,7 @@ import re
from parso import ParserSyntaxError from parso import ParserSyntaxError
from parso.python import tree from parso.python import tree
from jedi._compatibility import unicode, force_unicode
from jedi.evaluate.cache import evaluator_method_cache from jedi.evaluate.cache import evaluator_method_cache
from jedi.evaluate import compiled from jedi.evaluate import compiled
from jedi.evaluate.base_context import NO_CONTEXTS, ContextSet from jedi.evaluate.base_context import NO_CONTEXTS, ContextSet
@@ -32,7 +33,6 @@ from jedi.evaluate.lazy_context import LazyTreeContext
from jedi.evaluate.context import ModuleContext from jedi.evaluate.context import ModuleContext
from jedi.evaluate.helpers import is_string from jedi.evaluate.helpers import is_string
from jedi import debug from jedi import debug
from jedi import _compatibility
from jedi import parser_utils from jedi import parser_utils
@@ -64,7 +64,7 @@ def _fix_forward_reference(context, node):
if is_string(evaled_node): if is_string(evaled_node):
try: try:
new_node = context.evaluator.grammar.parse( new_node = context.evaluator.grammar.parse(
_compatibility.force_unicode(evaled_node.get_safe_value()), force_unicode(evaled_node.get_safe_value()),
start_symbol='eval_input', start_symbol='eval_input',
error_recovery=False error_recovery=False
) )
@@ -120,7 +120,7 @@ def _get_typing_replacement_module(grammar):
typing_path = \ typing_path = \
os.path.abspath(os.path.join(__file__, "../jedi_typing.py")) os.path.abspath(os.path.join(__file__, "../jedi_typing.py"))
with open(typing_path) as f: with open(typing_path) as f:
code = _compatibility.unicode(f.read()) code = unicode(f.read())
_typing_module = grammar.parse(code) _typing_module = grammar.parse(code)
return _typing_module return _typing_module
@@ -216,7 +216,7 @@ def _find_type_from_comment_hint(context, node, varlist, name):
if not match: if not match:
return [] return []
annotation = tree.String( annotation = tree.String(
repr(str(match.group(1).strip())), force_unicode(repr(str(match.group(1).strip()))),
node.start_pos) node.start_pos)
annotation.parent = node.parent annotation.parent = node.parent
return _evaluate_for_annotation(context, annotation, index) return _evaluate_for_annotation(context, annotation, index)