Skip to content

Commit d0dc39d

Browse files
committed
fix usage of x in integer_types,..
1 parent 79704da commit d0dc39d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

myhdl/conversion/_analyze.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
from myhdl._extractHierarchy import _isMem, _getMemInfo, _UserCode
4343
from myhdl._Signal import _Signal, _WaiterList
4444
from myhdl._ShadowSignal import _ShadowSignal, _SliceSignal
45-
from myhdl._util import _isTupleOfInts, _dedent, _makeAST
45+
from myhdl._util import _isTupleOfInts, _dedent, _flatten, _makeAST
4646
from myhdl._resolverefs import _AttrRefTransformer
4747
from myhdl._compat import builtins, integer_types
4848

@@ -576,7 +576,7 @@ def visit_Call(self, node):
576576
node.obj = int(0) # XXX
577577
elif f is bool:
578578
node.obj = bool()
579-
elif f in (integer_types, ord):
579+
elif f in _flatten(integer_types, ord):
580580
node.obj = int(-1)
581581
## elif f in (posedge , negedge):
582582
## node.obj = _EdgeDetector()

myhdl/conversion/_toVHDL.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040

4141
import myhdl
4242
from myhdl import *
43-
from myhdl._compat import integer_types, class_types, StringIO
4443
from myhdl import ToVHDLError, ToVHDLWarning
4544
from myhdl._extractHierarchy import (_HierExtr, _isMem, _getMemInfo,
4645
_UserVhdlCode, _userCodeMap)
@@ -52,6 +51,8 @@
5251
_Ram, _Rom, _enumTypeSet, _constDict, _extConstDict)
5352
from myhdl._Signal import _Signal,_WaiterList
5453
from myhdl.conversion._toVHDLPackage import _package
54+
from myhdl._util import _flatten
55+
from myhdl._compat import integer_types, class_types, StringIO
5556

5657

5758
_version = myhdl.__version__.replace('.','')
@@ -2053,7 +2054,7 @@ def visit_Call(self, node):
20532054
node.vhd = vhd_unsigned(s)
20542055
elif f is bool:
20552056
node.vhd = vhd_boolean()
2056-
elif f in (integer_types, ord):
2057+
elif f in _flatten(integer_types, ord):
20572058
node.vhd = vhd_int()
20582059
node.args[0].vhd = vhd_int()
20592060
elif f in (intbv, modbv):

0 commit comments

Comments
 (0)