Permalink
Browse files
Remove use of the io module, which was only for Python3 compatibility.
- Loading branch information...
Showing
with
7 additions
and
12 deletions.
-
+2
−2
asdl/arith_ast_test.py
-
+0
−1
asdl/format.py
-
+0
−1
asdl/py_meta.py
-
+2
−2
core/util.py
-
+0
−3
opy/opy_main.py
-
+3
−3
test/sh_spec_test.py
|
|
@@ -3,7 +3,7 @@ |
|
|
arith_ast_test.py: Tests for arith_ast.py
|
|
|
"""
|
|
|
|
|
|
import io
|
|
|
import cStringIO
|
|
|
import unittest
|
|
|
|
|
|
from asdl import format as fmt
|
|
|
@@ -79,7 +79,7 @@ def testEncode(self): |
|
|
print(obj)
|
|
|
|
|
|
enc = encode.Params()
|
|
|
f = io.BytesIO()
|
|
|
f = cStringIO.StringIO()
|
|
|
out = encode.BinOutput(f)
|
|
|
encode.EncodeRoot(obj, enc, out)
|
|
|
e = f.getvalue()
|
|
|
|
|
|
@@ -15,7 +15,6 @@ |
|
|
- abbreviated, unnamed fields
|
|
|
"""
|
|
|
|
|
|
import io
|
|
|
import re
|
|
|
import sys
|
|
|
|
|
|
|
|
|
@@ -26,7 +26,6 @@ |
|
|
put: an op is Add() and not Add, an instance of a class, not an integer value.
|
|
|
"""
|
|
|
|
|
|
import io
|
|
|
import sys
|
|
|
|
|
|
from asdl import asdl_ as asdl
|
|
|
|
|
|
@@ -13,7 +13,7 @@ |
|
|
easily to C++.
|
|
|
"""
|
|
|
|
|
|
import io
|
|
|
import cStringIO
|
|
|
import os
|
|
|
import pwd
|
|
|
import sys
|
|
|
@@ -25,7 +25,7 @@ |
|
|
|
|
|
from asdl import const
|
|
|
|
|
|
Buffer = io.BytesIO # used by asdl/format.py
|
|
|
Buffer = cStringIO.StringIO # used by asdl/format.py
|
|
|
|
|
|
|
|
|
class _ErrorWithLocation(Exception):
|
|
|
|
|
|
@@ -5,7 +5,6 @@ |
|
|
from __future__ import print_function
|
|
|
|
|
|
import cStringIO
|
|
|
import io
|
|
|
import optparse
|
|
|
import os
|
|
|
import sys
|
|
|
@@ -86,8 +85,6 @@ def __init__(self, driver, start_symbol): |
|
|
self.start_symbol = start_symbol
|
|
|
|
|
|
def suite(self, text):
|
|
|
# Python 3
|
|
|
#f = io.StringIO(text)
|
|
|
f = cStringIO.StringIO(text)
|
|
|
tokens = tokenize.generate_tokens(f.readline)
|
|
|
tree = self.driver.parse_tokens(tokens, start_symbol=self.start_symbol)
|
|
|
|
|
|
@@ -3,13 +3,13 @@ |
|
|
sh_spec_test.py: Tests for sh_spec.py
|
|
|
"""
|
|
|
|
|
|
import io
|
|
|
import cStringIO
|
|
|
import pprint
|
|
|
import unittest
|
|
|
|
|
|
from sh_spec import * # module under test
|
|
|
|
|
|
TEST1 = io.BytesIO("""\
|
|
|
TEST1 = cStringIO.StringIO("""\
|
|
|
### Env binding in readonly/declare disallowed
|
|
|
FOO=foo readonly v=$(tests/printenv.py FOO)
|
|
|
echo "v=$v"
|
|
|
@@ -24,7 +24,7 @@ |
|
|
CASE1 = ParseTestCase(Tokenizer(iter(TOKENS1)))
|
|
|
|
|
|
|
|
|
TEST2 = io.BytesIO("""\
|
|
|
TEST2 = cStringIO.StringIO("""\
|
|
|
### Multiline test case
|
|
|
echo one
|
|
|
echo two
|
|
|
|
0 comments on commit
c5fbf14