Skip to content

Commit ebeb57e

Browse files
committed
move StringIO to compat
1 parent 475b3e7 commit ebeb57e

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

myhdl/_compat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
string_types = (str,)
88
integer_types = (int,)
99
long = int
10+
11+
from io import StringIO
1012
import builtins
1113
else:
1214
string_types = (str, unicode)
1315
integer_types = (int, long)
1416
long = long
17+
18+
from cStringIO import StringIO
1519
import __builtin__ as builtins

myhdl/_unparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
import compiler
27-
from cStringIO import StringIO
27+
from myhdl._compat import StringIO
2828

2929
def _unparse(ast):
3030
v = _UnparseVisitor()

myhdl/_util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@
2929
import inspect
3030

3131
from tokenize import generate_tokens, untokenize, INDENT
32-
from cStringIO import StringIO
3332

34-
from myhdl._compat import integer_types
33+
from myhdl._compat import integer_types, StringIO
3534

3635
def _printExcInfo():
3736
kind, value = sys.exc_info()[:2]

myhdl/conversion/_toVHDL.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@
3434
#from compiler import ast as astNode
3535
import ast
3636
from types import GeneratorType, ClassType
37-
from cStringIO import StringIO
3837
import warnings
3938
from copy import copy
4039
import string
4140

4241
import myhdl
4342
from myhdl import *
44-
from myhdl._compat import integer_types
43+
from myhdl._compat import integer_types, StringIO
4544
from myhdl import ToVHDLError, ToVHDLWarning
4645
from myhdl._extractHierarchy import (_HierExtr, _isMem, _getMemInfo,
4746
_UserVhdlCode, _userCodeMap)

myhdl/conversion/_toVerilog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import string
3535

3636
from types import GeneratorType, ClassType, TypeType
37-
from cStringIO import StringIO
37+
from myhdl._compat import StringIO
3838
import warnings
3939

4040
import myhdl

0 commit comments

Comments
 (0)