mirror of
https://github.com/myhdl/myhdl.git
synced 2025-01-24 21:52:56 +08:00
_util.py: remove unused imports
This commit is contained in:
parent
78eba1bb37
commit
2894164a6d
@ -23,18 +23,15 @@
|
|||||||
|
|
||||||
|
|
||||||
import ast
|
import ast
|
||||||
import exceptions
|
|
||||||
import sys
|
import sys
|
||||||
import inspect
|
import inspect
|
||||||
import re
|
|
||||||
from types import FunctionType, GeneratorType, ListType, TupleType
|
|
||||||
|
|
||||||
from tokenize import generate_tokens, untokenize, INDENT
|
from tokenize import generate_tokens, untokenize, INDENT
|
||||||
from cStringIO import StringIO
|
from cStringIO import StringIO
|
||||||
|
|
||||||
|
|
||||||
def _printExcInfo():
|
def _printExcInfo():
|
||||||
kind, value = sys.exc_info()[:2]
|
kind, value = sys.exc_info()[:2]
|
||||||
msg = str(kind)
|
msg = str(kind)
|
||||||
# msg = msg[msg.rindex('.')+1:]
|
# msg = msg[msg.rindex('.')+1:]
|
||||||
if str(value):
|
if str(value):
|
||||||
@ -43,6 +40,7 @@ def _printExcInfo():
|
|||||||
|
|
||||||
_isGenFunc = inspect.isgeneratorfunction
|
_isGenFunc = inspect.isgeneratorfunction
|
||||||
|
|
||||||
|
|
||||||
def _flatten(*args):
|
def _flatten(*args):
|
||||||
arglist = []
|
arglist = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
@ -53,6 +51,7 @@ def _flatten(*args):
|
|||||||
arglist.append(arg)
|
arglist.append(arg)
|
||||||
return arglist
|
return arglist
|
||||||
|
|
||||||
|
|
||||||
def _isTupleOfInts(obj):
|
def _isTupleOfInts(obj):
|
||||||
if not isinstance(obj, tuple):
|
if not isinstance(obj, tuple):
|
||||||
return False
|
return False
|
||||||
@ -61,6 +60,7 @@ def _isTupleOfInts(obj):
|
|||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def _dedent(s):
|
def _dedent(s):
|
||||||
"""Dedent python code string."""
|
"""Dedent python code string."""
|
||||||
|
|
||||||
@ -70,6 +70,7 @@ def _dedent(s):
|
|||||||
result[0] = (INDENT, '')
|
result[0] = (INDENT, '')
|
||||||
return untokenize(result)
|
return untokenize(result)
|
||||||
|
|
||||||
|
|
||||||
def _makeAST(f):
|
def _makeAST(f):
|
||||||
s = inspect.getsource(f)
|
s = inspect.getsource(f)
|
||||||
s = _dedent(s)
|
s = _dedent(s)
|
||||||
@ -78,6 +79,7 @@ def _makeAST(f):
|
|||||||
tree.lineoffset = inspect.getsourcelines(f)[1]-1
|
tree.lineoffset = inspect.getsourcelines(f)[1]-1
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
|
||||||
def _genfunc(gen):
|
def _genfunc(gen):
|
||||||
from myhdl._always_comb import _AlwaysComb
|
from myhdl._always_comb import _AlwaysComb
|
||||||
from myhdl._always_seq import _AlwaysSeq
|
from myhdl._always_seq import _AlwaysSeq
|
||||||
|
Loading…
x
Reference in New Issue
Block a user