From 299f52c04bd407ee366a0910805ccdf2f5e4f9c2 Mon Sep 17 00:00:00 2001 From: David Halter Date: Fri, 2 Nov 2012 18:10:23 +0100 Subject: [PATCH] renamed BytesIO to StringIO, because it no longer made sense --- jedi/_compatibility.py | 6 +++--- jedi/parsing.py | 4 ++-- test/run.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/jedi/_compatibility.py b/jedi/_compatibility.py index 26b51990..de031f90 100644 --- a/jedi/_compatibility.py +++ b/jedi/_compatibility.py @@ -73,11 +73,11 @@ else: import tokenize tokenize_func = tokenize.generate_tokens -# BytesIO (Python 2.5 has no io module) +# StringIO (Python 2.5 has no io module), so use io only for py3k try: - from StringIO import StringIO as BytesIO + from StringIO import StringIO except ImportError: - from io import StringIO as BytesIO + from io import StringIO # hasattr function used because python if is_py3k: diff --git a/jedi/parsing.py b/jedi/parsing.py index f0ab6836..db91ba26 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -28,7 +28,7 @@ All those classes are being generated by PyFuzzyParser, which takes python text as input and ignores just all the non-python stuff. Basically you could feed it a perl script, and it should still work (which means throw no error. """ -from _compatibility import (next, literal_eval, tokenize_func, BytesIO, +from _compatibility import (next, literal_eval, tokenize_func, StringIO, property, is_py3k, cleandoc, Python3Method) import tokenize @@ -1592,7 +1592,7 @@ class PyFuzzyParser(object): :raises: IndentationError """ - self.buf = BytesIO(self.code) + self.buf = StringIO(self.code) self.gen = PushBackIterator(tokenize_func(self.buf.readline)) extended_flow = ['else', 'elif', 'except', 'finally'] diff --git a/test/run.py b/test/run.py index f2243b87..f3f89c5d 100755 --- a/test/run.py +++ b/test/run.py @@ -8,7 +8,7 @@ from os.path import abspath, dirname sys.path.append(abspath(dirname(abspath(__file__)) + '/../jedi')) os.chdir(dirname(abspath(__file__)) + '/../jedi') -from _compatibility import unicode, BytesIO, reduce, literal_eval, is_py25 +from _compatibility import unicode, StringIO, reduce, literal_eval, is_py25 import api import debug @@ -142,7 +142,7 @@ def run_test(source, f_name, lines_to_execute): correct = None test_type = None start = None - for line_nr, line in enumerate(BytesIO(source)): + for line_nr, line in enumerate(StringIO(source)): line = unicode(line) line_nr += 1 if correct: