mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 23:34:45 +08:00
renamed BytesIO to StringIO, because it no longer made sense
This commit is contained in:
@@ -73,11 +73,11 @@ else:
|
|||||||
import tokenize
|
import tokenize
|
||||||
tokenize_func = tokenize.generate_tokens
|
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:
|
try:
|
||||||
from StringIO import StringIO as BytesIO
|
from StringIO import StringIO
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from io import StringIO as BytesIO
|
from io import StringIO
|
||||||
|
|
||||||
# hasattr function used because python
|
# hasattr function used because python
|
||||||
if is_py3k:
|
if is_py3k:
|
||||||
|
|||||||
@@ -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
|
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.
|
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)
|
property, is_py3k, cleandoc, Python3Method)
|
||||||
|
|
||||||
import tokenize
|
import tokenize
|
||||||
@@ -1592,7 +1592,7 @@ class PyFuzzyParser(object):
|
|||||||
|
|
||||||
:raises: IndentationError
|
:raises: IndentationError
|
||||||
"""
|
"""
|
||||||
self.buf = BytesIO(self.code)
|
self.buf = StringIO(self.code)
|
||||||
self.gen = PushBackIterator(tokenize_func(self.buf.readline))
|
self.gen = PushBackIterator(tokenize_func(self.buf.readline))
|
||||||
|
|
||||||
extended_flow = ['else', 'elif', 'except', 'finally']
|
extended_flow = ['else', 'elif', 'except', 'finally']
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ from os.path import abspath, dirname
|
|||||||
sys.path.append(abspath(dirname(abspath(__file__)) + '/../jedi'))
|
sys.path.append(abspath(dirname(abspath(__file__)) + '/../jedi'))
|
||||||
os.chdir(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 api
|
||||||
import debug
|
import debug
|
||||||
@@ -142,7 +142,7 @@ def run_test(source, f_name, lines_to_execute):
|
|||||||
correct = None
|
correct = None
|
||||||
test_type = None
|
test_type = None
|
||||||
start = None
|
start = None
|
||||||
for line_nr, line in enumerate(BytesIO(source)):
|
for line_nr, line in enumerate(StringIO(source)):
|
||||||
line = unicode(line)
|
line = unicode(line)
|
||||||
line_nr += 1
|
line_nr += 1
|
||||||
if correct:
|
if correct:
|
||||||
|
|||||||
Reference in New Issue
Block a user