diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index ade16ef1..26b51990 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -69,17 +69,15 @@ else: exec source in global_map """, 'blub', 'exec')) # tokenize function +# TODO remove this, not used anymore import tokenize -if is_py3k: - tokenize_func = tokenize.tokenize -else: - tokenize_func = tokenize.generate_tokens +tokenize_func = tokenize.generate_tokens # BytesIO (Python 2.5 has no io module) try: from StringIO import StringIO as BytesIO except ImportError: - from io import BytesIO as BytesIO + from io import StringIO as BytesIO # hasattr function used because python if is_py3k: diff --git a/jedi/parsing.py b/jedi/parsing.py index ce0ea63c..f0ab6836 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -1126,8 +1126,6 @@ class PyFuzzyParser(object): self.user_stmt = None self.code = code + '\n' # end with \n, because the parser needs it self.no_docstr = no_docstr - if is_py3k: - self.code = self.code.encode() # initialize global Scope self.module = Module(module_path) diff --git a/test/run.py b/test/run.py index a3304997..f2243b87 100755 --- a/test/run.py +++ b/test/run.py @@ -212,8 +212,7 @@ def test_dir(completion_test_dir, thirdparty=False): path = os.path.join(completion_test_dir, f_name) f = open(path) - num_tests, fails = run_test(unicode(f.read()), f_name, - lines_to_execute) + num_tests, fails = run_test(f.read(), f_name, lines_to_execute) s = 'run %s tests with %s fails (%s)' % (num_tests, fails, f_name) tests_fail += fails