Skip to content

Commit 0224b76

Browse files
author
Katharina Ceesay-Seitz
committed
Make it Python3 friendly
1 parent c5cf594 commit 0224b76

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

hdlparse/minilexer.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, tokens, flags=re.MULTILINE):
2222
self.tokens = {}
2323

2424
# Pre-process the state definitions
25-
for state, patterns in tokens.iteritems():
25+
for state, patterns in tokens.items():
2626
full_patterns = []
2727
for p in patterns:
2828
pat = re.compile(p[0], flags)
@@ -33,7 +33,7 @@ def __init__(self, tokens, flags=re.MULTILINE):
3333
if new_state and new_state.startswith('#pop'):
3434
try:
3535
new_state = -int(new_state.split(':')[1])
36-
except IndexError, ValueError:
36+
except (IndexError, ValueError):
3737
new_state = -1
3838

3939
full_patterns.append((pat, action, new_state))

hdlparse/vhdl_parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ def _register_array_types(self, objects):
753753
subtypes = {o.name:o.base_type for o in objects if isinstance(o, VhdlSubtype)}
754754

755755
# Find all subtypes of an array type
756-
for k,v in subtypes.iteritems():
756+
for k,v in subtypes.items():
757757
while v in subtypes: # Follow subtypes of subtypes
758758
v = subtypes[v]
759759
if v in self.array_types:

0 commit comments

Comments
 (0)