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 copy
import itertools 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 parsing_representation as pr
from jedi import cache from jedi import cache
from jedi import helpers from jedi import helpers

View File

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

View File

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