unicode issues in usage matching

This commit is contained in:
Dave Halter
2014-04-29 12:20:25 +02:00
parent 5740c45791
commit bc7896f93d
3 changed files with 5 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
from jedi._compatibility import unicode
from jedi._compatibility import u
from jedi import common
from jedi.api import classes
from jedi.parser import representation as pr
@@ -33,7 +33,7 @@ def usages(evaluator, definitions, search_name, mods):
call_path = list(call.generate_call_path())
for i, name in enumerate(call_path):
# name is `pr.NamePart`.
if unicode(name) == search_name:
if u(name) == search_name:
follow.append(call_path[:i + 1])
for call_path in follow:

View File

@@ -182,8 +182,7 @@ def _literals_to_types(evaluator, result):
# Literals are only valid as long as the operations are
# correct. Otherwise add a value-free instance.
cls = builtin.get_by_name(r.name)
from jedi.evaluate import representation as er
result[i] = er.Instance(evaluator, cls)
result[i] = evaluator.execute(cls)[0]
return list(set(result))

View File

@@ -10,6 +10,8 @@ def abc(): pass
abc.d.a.bsaasd.abc.d
abc
# unicode chars shouldn't be a problem.
x['smörbröd'].abc
if 1:
abc =