diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 1f839c8a..255660b5 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -168,6 +168,8 @@ def u(string): have to cast back to a unicode (and we now that we always deal with valid unicode, because we check that in the beginning). """ - if not is_py3k and not isinstance(string, unicode): + if is_py3k: + return str(string) + elif not isinstance(string, unicode): return unicode(str(string), 'UTF-8') return string diff --git a/jedi/debug.py b/jedi/debug.py index cea7b30a..d9f30dc8 100644 --- a/jedi/debug.py +++ b/jedi/debug.py @@ -48,7 +48,7 @@ def warning(*args): def speed(name): if debug_function and enable_speed: now = time.time() - debug_function(SPEED, 'speed: ' + '%s %s' % (u(name), now - start_time)) + debug_function(SPEED, 'speed: ' + '%s %s' % (name, now - start_time)) def print_to_stdout(level, str_out):