diff --git a/jedi/api/file_name.py b/jedi/api/file_name.py index e41fef07..b0486c67 100644 --- a/jedi/api/file_name.py +++ b/jedi/api/file_name.py @@ -93,7 +93,7 @@ def _add_strings(context, nodes, add_slash=False): return None if not first and add_slash: string += os.path.sep - string += str(s, errors='replace') + string += s first = False return string diff --git a/jedi/inference/helpers.py b/jedi/inference/helpers.py index 3e4d3952..8f7052d6 100644 --- a/jedi/inference/helpers.py +++ b/jedi/inference/helpers.py @@ -144,7 +144,7 @@ def get_int_or_none(value): def get_str_or_none(value): - return _get_safe_value_or_none(value, (bytes, unicode)) + return _get_safe_value_or_none(value, str) def is_number(value): diff --git a/test/test_api/test_completion.py b/test/test_api/test_completion.py index a0d23ef3..45716708 100644 --- a/test/test_api/test_completion.py +++ b/test/test_api/test_completion.py @@ -244,9 +244,7 @@ current_dirname = os.path.basename(dirname(dirname(dirname(__file__)))) ('example.py', 'x = f("te" + "st"', 16, [s]), ('example.py', 'x = f("te" + "st")', 16, [s]), ('example.py', 'x = f("t" + "est")', 16, [s]), - # This is actually not correct, but for now leave it here, because of - # Python 2. - ('example.py', 'x = f(b"t" + "est")', 17, [s]), + ('example.py', 'x = f(b"t" + "est")', 17, []), ('example.py', '"test" + "', None, [s]), # __file__