1
0
forked from VimPlug/jedi

fixed a unicode test problem

This commit is contained in:
David Halter
2013-07-18 14:54:40 +02:00
parent 681b9d6371
commit dd6967de7c
3 changed files with 12 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ from __future__ import with_statement
import copy
import itertools
from jedi._compatibility import use_metaclass, next, hasattr
from jedi._compatibility import use_metaclass, next, hasattr, unicode
from jedi import parsing_representation as pr
from jedi import cache
from jedi import helpers

View File

@@ -231,3 +231,11 @@ class A():
self.hello = {} # comment shouldn't be a string
#? dict()
A().hello
# -----------------
# unicode
# -----------------
a = 'smörbröd'
#? str()
a

View File

@@ -105,7 +105,7 @@ if __name__ == '__main__':
sys.path.insert(0, '..')
import jedi
from jedi._compatibility import unicode, reduce, StringIO
from jedi._compatibility import unicode, reduce, StringIO, is_py3k
TEST_COMPLETIONS = 0
@@ -221,7 +221,8 @@ def collect_file_tests(lines, lines_to_execute):
test_type = None
for line_nr, line in enumerate(lines):
line_nr += 1 # py2.5 doesn't know about the additional enumerate param
line = unicode(line)
if not is_py3k:
line = unicode(line, 'UTF-8')
if correct:
r = re.match('^(\d+)\s*(.*)$', correct)
if r: